Class: String
Instance Method Summary collapse
Instance Method Details
#camelize(first_letter = :upper) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/bing/core_ext.rb', line 36 def camelize first_letter = :upper case first_letter when :upper then self.gsub(/\/(.?)/) {"::#{$1.upcase}"}.gsub(/(?:^|_)(.)/) {$1.upcase} when :lower then self[0].chr.downcase + camelize()[1..-1] end end |