lib/happymapper/anonymous_mapper.rb
#
# Borrowed from Active Support to convert unruly element names into a format
# known and loved by Rubyists.
#
Borrowed from Active Support to convert unruly element names into a format
known and loved by Rubyists.
Borrowed from Active Support to convert unruly element names into a format known and loved by Rubyists .
def underscore(camel_cased_word)
      word = camel_cased_word.to_s.dup
      word.gsub!(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2')
      word.gsub!(/([a-z\d])([A-Z])/, '\1_\2')
      word.tr!('-', '_')
      word.downcase!
      word
    end
def underscore ( camel_cased_word ) word = camel_cased_word . to_s . dup word . gsub! ( / ([A-Z \d ]+)([A-Z][a-z]) / , '\1_\2' ) word . gsub! ( / ([a-z \d ])([A-Z]) / , '\1_\2' ) word . tr! ( '-' , '_' ) word . downcase! word end
Borrowed from Active Support to convert unruly element names into a format
known and loved by Rubyists.
Borrowed from Active Support to convert unruly element names into a format known and loved by Rubyists .
camel_cased_word
<not_specific>