Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/contxtlservice.rb
Instance Method Summary collapse
Instance Method Details
#camel_case_to_underscore ⇒ Object
161 162 163 |
# File 'lib/contxtlservice.rb', line 161 def camel_case_to_underscore ( gsub( /(.)([A-Z])/ ) { $1 + '_' + $2.downcase } ).downcase end |
#underscore_to_camel_case ⇒ Object
167 168 169 |
# File 'lib/contxtlservice.rb', line 167 def underscore_to_camel_case capitalize.gsub( /_([a-zA-Z0-9]+)/ ) { |s| s[1,s.size - 1].capitalize } end |