Module: ROM::InflectorMethods
- Defined in:
- lib/rom/support/inflector.rb
Instance Method Summary collapse
-
#camelize(name) ⇒ Object
ZeitwerkCompatibility.
-
#component_id(value) ⇒ Object
Default for inferring ids from class names or any string/symbol.
-
#namespace(value) ⇒ Object
Default for inferring namespace from class names or any string/symbol.
Instance Method Details
#camelize(name) ⇒ Object
ZeitwerkCompatibility
8 9 10 |
# File 'lib/rom/support/inflector.rb', line 8 def camelize(name, *) super(name) end |
#component_id(value) ⇒ Object
Default for inferring ids from class names or any string/symbol
13 14 15 16 |
# File 'lib/rom/support/inflector.rb', line 13 def component_id(value) name = (value.is_a?(Class) ? (value.name || value.superclass.name) : value).to_s underscore(demodulize(name)).to_sym end |
#namespace(value) ⇒ Object
Default for inferring namespace from class names or any string/symbol
19 20 21 22 |
# File 'lib/rom/support/inflector.rb', line 19 def namespace(value) name = (value.is_a?(Class) ? (value.name || value.superclass.name) : value).to_s pluralize(underscore(demodulize(name))).to_sym end |