Method: Ebay::Inflections#ebay_camelize
- Defined in:
- lib/ebay/inflections.rb
#ebay_camelize(lower_case_and_underscored_word) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/ebay/inflections.rb', line 29 def ebay_camelize(lower_case_and_underscored_word) lower_case_and_underscored_word.to_s.gsub(/\/(.?)/) { "::" + $1.upcase }. gsub(/(^|_)(.)/) { $2.upcase }. gsub(/(#{NAME_MAPPINGS.keys.collect{|k| k.capitalize}.join('|')})/){ NAME_MAPPINGS[$1.downcase] }. gsub(UPCASE_TOKENS) { $1.upcase } end |