Class: Symbol

Inherits:
Object
  • Object
show all
Defined in:
lib/rabbitcage/core_extensions.rb

Instance Method Summary collapse

Instance Method Details

#camelize(first_letter_in_uppercase = true) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/rabbitcage/core_extensions.rb', line 13

def camelize(first_letter_in_uppercase = true)
  if first_letter_in_uppercase
    self.to_s.gsub(/\/(.?)/) { "::#{$1.upcase}" }.gsub(/(?:^|_)(.)/) { $1.upcase }
  else
    self.first + self.camelize[1..-1]
  end
end