class Deserializer::Attribute::Attribute
Public Class Methods
new( type, name, opts )
click to toggle source
# File lib/deserializer/attribute/attribute.rb, line 4 def initialize( type, name, opts ) @type = type @name = name @opts = opts end
Public Instance Methods
key()
click to toggle source
# File lib/deserializer/attribute/attribute.rb, line 10 def key @opts.fetch :key, @name end
to_hash( params, object )
click to toggle source
# File lib/deserializer/attribute/attribute.rb, line 14 def to_hash( params, object ) attribute = @type.new( @name, @opts, object ) attribute.to_hash( params ) end