Module: Utilities

Included in:
NgComponentGenerator, NgDataGenerator, NgSectionGenerator
Defined in:
lib/generators/lib/utilities.rb

Instance Method Summary collapse

Instance Method Details

#formatted_name(name, camelize = true, uncapitalize_first = true) ⇒ Object



7
8
9
10
11
# File 'lib/generators/lib/utilities.rb', line 7

def formatted_name(name, camelize=true, uncapitalize_first=true)
  name = name.camelize if camelize
  name = uncapitalize_first_char(name) if uncapitalize_first
  name
end

#uncapitalize_first_char(s) ⇒ Object



3
4
5
# File 'lib/generators/lib/utilities.rb', line 3

def uncapitalize_first_char(s)
  s[0, 1].downcase + s[1..-1]
end