Module: Hashie::Extensions::Dash::Coercion::ClassMethods
- Defined in:
- lib/hashie/extensions/dash/coercion.rb
Instance Method Summary collapse
-
#property(property_name, options = {}) ⇒ Object
Defines a property on the Dash.
Instance Method Details
#property(property_name, options = {}) ⇒ Object
Defines a property on the Dash. Options are the standard Hashie::Dash#property options plus:
- :coerce - The class into which you want the property coerced.
17 18 19 20 |
# File 'lib/hashie/extensions/dash/coercion.rb', line 17 def property(property_name, = {}) super coerce_key property_name, [:coerce] if [:coerce] end |