Class: Deserializer::Attribute::ValueAttribute
- Defined in:
- lib/deserializer/attribute/value_attribute.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Deserializer::Attribute::Base
Instance Method Details
#value(params) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/deserializer/attribute/value_attribute.rb', line 5 def value( params ) value = params[key] if opts[:ignore_empty] && value.blank? return :ignore end if opts[:convert_with] method = opts[:convert_with] if object.respond_to? method return object.send method, value end end # other options go here value end |