Class: AdequateSerialization::Attribute::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/adequate_serialization/attribute.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attribute, options) ⇒ Config

Returns a new instance of Config.



100
101
102
103
# File 'lib/adequate_serialization/attribute.rb', line 100

def initialize(attribute, options)
  @attribute = attribute
  @options = options
end

Instance Attribute Details

#attributeObject (readonly)

Returns the value of attribute attribute.



98
99
100
# File 'lib/adequate_serialization/attribute.rb', line 98

def attribute
  @attribute
end

#optionsObject (readonly)

Returns the value of attribute options.



98
99
100
# File 'lib/adequate_serialization/attribute.rb', line 98

def options
  @options
end

Instance Method Details

#to_attributeObject



105
106
107
108
# File 'lib/adequate_serialization/attribute.rb', line 105

def to_attribute
  nested = nested_attribute_from(attribute, options)
  nested ? Config.new(nested, options).to_attribute : attribute
end