Class: String
Instance Method Summary collapse
Instance Method Details
#camelize(first_letter = :upper) ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/bing/core_ext.rb', line 49 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 |