Module: Virtus::Mapper
- Defined in:
- lib/virtus/mapper.rb,
lib/virtus/mapper/version.rb
Constant Summary collapse
- VERSION =
"0.2.0"
Instance Attribute Summary collapse
-
#mapped_attributes ⇒ Object
readonly
Returns the value of attribute mapped_attributes.
Instance Method Summary collapse
Instance Attribute Details
#mapped_attributes ⇒ Object (readonly)
Returns the value of attribute mapped_attributes.
10 11 12 |
# File 'lib/virtus/mapper.rb', line 10 def mapped_attributes @mapped_attributes end |
Instance Method Details
#extend_with(mod) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/virtus/mapper.rb', line 17 def extend_with(mod) attr_set = attribute_set self.extend(mod) # Virtus modifies attribute_set set_attr_values(attribute_set.collect(&:name)) update_attribute_set(attr_set) end |
#initialize(attrs = {}) ⇒ Object
12 13 14 15 |
# File 'lib/virtus/mapper.rb', line 12 def initialize(attrs={}) @mapped_attributes = HWIA.new(attrs) super(prepare_attributes_for_assignment!(@mapped_attributes)) end |