lib/hashie/extensions/dash/property_translation.rb
# Defines a property on the Trash. Options are as follows:
#
# * <tt>:default</tt> - Specify a default value for this property, to be
# returned before a value is set on the property in a new Dash.
# * <tt>:from</tt> - Specify the original key name that will be write only.
# * <tt>:with</tt> - Specify a lambda to be used to convert value.
# * <tt>:transform_with</tt> - Specify a lambda to be used to convert value
# without using the :from option. It transform the property itself.
Defines a property on the Trash. Options are as follows:
:default - Specify a default value for this property, to be
returned before a value is set on the property in a new Dash.
:from - Specify the original key name that will be write only.
:with - Specify a lambda to be used to convert value.
:transform_with - Specify a lambda to be used to convert value
without using the :from option. It transform the property itself.
Defines a property on the Trash . Options are as follows : : default - Specify a default value for this property to be returned before a value is set on the property in a new Dash . : from - Specify the original key name that will be write only . : with - Specify a lambda to be used to convert value . : transform_with - Specify a lambda to be used to convert value without using the : from option . It transform the property itself .
def property(property_name, options = {})
            super
            from = options[:from]
            converter = options[:with]
            transformer = options[:transform_with]
            if from
              fail_self_transformation_error!(property_name) if property_name == from
              define_translation(from, property_name, converter || transformer)
              define_writer_for_source_property(from)
            elsif valid_transformer?(transformer)
              transforms[property_name] = transformer
            end
          end
def property ( property_name , options = { } ) super from = options [ :from ] converter = options [ :with ] transformer = options [ :transform_with ] if from fail_self_transformation_error! ( property_name ) if property_name == from define_translation ( from , property_name , converter || transformer ) define_writer_for_source_property ( from ) elsif valid_transformer? ( transformer ) transforms [ property_name ] = transformer end end
Defines a property on the Trash.
Defines a property on the Trash .
property_name
options