Class: Pennyworth::Inflector
- Inherits:
-
Object
- Object
- Pennyworth::Inflector
- Defined in:
- lib/pennyworth/inflector.rb
Overview
Overrides any string to desired form if matched, otherwise answers the original string.
Constant Summary collapse
- DEFAULTS =
Array(Container[:settings].inflections).reduce({}, :merge)
Instance Method Summary collapse
- #call(key) ⇒ Object
-
#initialize(overrides = DEFAULTS) ⇒ Inflector
constructor
A new instance of Inflector.
Constructor Details
Instance Method Details
#call(key) ⇒ Object
12 |
# File 'lib/pennyworth/inflector.rb', line 12 def call(key) = overrides.fetch(key) { |fallback| fallback } |