Module: Inflections
- Included in:
- String
- Defined in:
- lib/simple_mapper/support/inflections.rb
Overview
:nodoc:
Instance Method Summary collapse
- #camelize(first_letter = :upper) ⇒ Object (also: #camelcase)
- #classify ⇒ Object
- #constantize ⇒ Object
- #dasherize ⇒ Object
- #demodulize ⇒ Object
- #foreign_key(separate_class_name_and_id_with_underscore = true) ⇒ Object
- #humanize ⇒ Object
- #pluralize ⇒ Object
- #singularize ⇒ Object
- #tableize ⇒ Object
- #titleize ⇒ Object (also: #titlecase)
- #underscore ⇒ Object
Instance Method Details
#camelize(first_letter = :upper) ⇒ Object Also known as: camelcase
64 65 66 67 68 69 |
# File 'lib/simple_mapper/support/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 |
#classify ⇒ Object
93 94 95 |
# File 'lib/simple_mapper/support/inflections.rb', line 93 def classify Inflector.classify(self) end |
#constantize ⇒ Object
105 106 107 |
# File 'lib/simple_mapper/support/inflections.rb', line 105 def constantize Inflector.constantize(self) end |
#dasherize ⇒ Object
81 82 83 |
# File 'lib/simple_mapper/support/inflections.rb', line 81 def dasherize Inflector.dasherize(self) end |
#demodulize ⇒ Object
85 86 87 |
# File 'lib/simple_mapper/support/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/simple_mapper/support/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 |
#humanize ⇒ Object
97 98 99 |
# File 'lib/simple_mapper/support/inflections.rb', line 97 def humanize Inflector.humanize(self) end |
#pluralize ⇒ Object
56 57 58 |
# File 'lib/simple_mapper/support/inflections.rb', line 56 def pluralize Inflector.pluralize(self) end |
#singularize ⇒ Object
60 61 62 |
# File 'lib/simple_mapper/support/inflections.rb', line 60 def singularize Inflector.singularize(self) end |
#tableize ⇒ Object
89 90 91 |
# File 'lib/simple_mapper/support/inflections.rb', line 89 def tableize Inflector.tableize(self) end |
#titleize ⇒ Object Also known as: titlecase
72 73 74 |
# File 'lib/simple_mapper/support/inflections.rb', line 72 def titleize Inflector.titleize(self) end |
#underscore ⇒ Object
77 78 79 |
# File 'lib/simple_mapper/support/inflections.rb', line 77 def underscore Inflector.underscore(self) end |