Class: String

Inherits:
Object show all
Defined in:
lib/support/string.rb

Instance Method Summary collapse

Instance Method Details

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



3
4
5
6
7
8
9
10
# File 'lib/support/string.rb', line 3

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

#constantizeObject



14
15
16
# File 'lib/support/string.rb', line 14

def constantize
  ActiveSupport::Inflector.constantize(self)
end

#demodulizeObject



22
23
24
# File 'lib/support/string.rb', line 22

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

#underscoreObject



18
19
20
# File 'lib/support/string.rb', line 18

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