Module: Lwes::Helpers
- Included in:
- Serialization
- Defined in:
- lib/lwes/helpers.rb
Instance Method Summary collapse
-
#camelcase(str) ⇒ Object
converts snake cased strings to camelcase.
Instance Method Details
#camelcase(str) ⇒ Object
converts snake cased strings to camelcase
4 5 6 7 |
# File 'lib/lwes/helpers.rb', line 4 def camelcase(str) str = str.to_s str.gsub(/^[a-z]|_+[a-z]/){|str| str.upcase}.gsub("_", '') end |