Module: Hashie::Extensions::Dash::Coercion::ClassMethods

Defined in:
lib/hashie/extensions/dash/coercion.rb

Instance Method Summary collapse

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, options = {})
  super
  coerce_key property_name, options[:coerce] if options[:coerce]
end