Module: Inflections

Included in:
String
Defined in:
lib/assistance/inflections.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

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



64
65
66
67
68
69
# File 'lib/assistance/inflections.rb', line 64

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

#classifyObject



93
94
95
# File 'lib/assistance/inflections.rb', line 93

def classify
  Inflector.classify(self)
end

#constantizeObject



105
106
107
# File 'lib/assistance/inflections.rb', line 105

def constantize
  Inflector.constantize(self)
end

#dasherizeObject



81
82
83
# File 'lib/assistance/inflections.rb', line 81

def dasherize
  Inflector.dasherize(self)
end

#demodulizeObject



85
86
87
# File 'lib/assistance/inflections.rb', line 85

def demodulize
  Inflector.demodulize(self)
end

#foreign_key(separate_class_name_and_id_with_underscore = true) ⇒ Object



101
102
103
# File 'lib/assistance/inflections.rb', line 101

def foreign_key(separate_class_name_and_id_with_underscore = true)
  Inflector.foreign_key(self, separate_class_name_and_id_with_underscore)
end

#humanizeObject



97
98
99
# File 'lib/assistance/inflections.rb', line 97

def humanize
  Inflector.humanize(self)
end

#pluralizeObject



56
57
58
# File 'lib/assistance/inflections.rb', line 56

def pluralize
  Inflector.pluralize(self)
end

#singularizeObject



60
61
62
# File 'lib/assistance/inflections.rb', line 60

def singularize
  Inflector.singularize(self)
end

#tableizeObject



89
90
91
# File 'lib/assistance/inflections.rb', line 89

def tableize
  Inflector.tableize(self)
end

#titleizeObject Also known as: titlecase



72
73
74
# File 'lib/assistance/inflections.rb', line 72

def titleize
  Inflector.titleize(self)
end

#underscoreObject



77
78
79
# File 'lib/assistance/inflections.rb', line 77

def underscore
  Inflector.underscore(self)
end