Class: ActiveRecord::XmlSerializer::ValueAttribute
- Inherits:
-
Attribute
- Object
- Attribute
- ActiveRecord::XmlSerializer::ValueAttribute
- Defined in:
- lib/xml_serializer_dumper_support.rb
Overview
An attribute where the type and value are based on the values when created
Instance Method Summary collapse
-
#compute_type ⇒ Object
:nodoc:.
-
#compute_value ⇒ Object
:nodoc:.
-
#initialize(name, record, value) ⇒ ValueAttribute
constructor
A new instance of ValueAttribute.
Constructor Details
#initialize(name, record, value) ⇒ ValueAttribute
Returns a new instance of ValueAttribute.
34 35 36 37 |
# File 'lib/xml_serializer_dumper_support.rb', line 34 def initialize(name, record, value) @value = value super(name, record) end |
Instance Method Details
#compute_type ⇒ Object
:nodoc:
43 44 45 |
# File 'lib/xml_serializer_dumper_support.rb', line 43 def compute_type#:nodoc: Hash::XML_TYPE_NAMES[@value.class.name] || :string end |
#compute_value ⇒ Object
:nodoc:
39 40 41 |
# File 'lib/xml_serializer_dumper_support.rb', line 39 def compute_value#:nodoc: @value end |