Method: Ebay::Inflections#ebay_underscore

Defined in:
lib/ebay/inflections.rb

#ebay_underscore(camel_cased_word) ⇒ Object



36
37
38
39
40
41
# File 'lib/ebay/inflections.rb', line 36

def ebay_underscore(camel_cased_word)
  underscore(camel_cased_word.to_s.gsub(/(#{NAME_MAPPINGS.values.join('|')})/i){ upcase_first_character($1.downcase) }.
    gsub(DOWNCASE_TOKENS){ $1.downcase }.
    gsub(/(ids$)/i) { $1.upcase }
  )
end