Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/garb/core_ext/string.rb

Instance Method Summary collapse

Instance Method Details

#camelize(first_letter = :upper) ⇒ Object Also known as: camelcase



4
5
6
7
8
9
# File 'lib/garb/core_ext/string.rb', line 4

def camelize(first_letter = :upper)
  case first_letter
    when :upper then Garb::Inflector.camelize(self, true)
    when :lower then Garb::Inflector.camelize(self, false)
  end
end

#demodulizeObject



16
17
18
# File 'lib/garb/core_ext/string.rb', line 16

def demodulize
  Garb::Inflector.demodulize(self)
end

#underscoreObject



12
13
14
# File 'lib/garb/core_ext/string.rb', line 12

def underscore
  Garb::Inflector.underscore(self)
end