Module: ActiveType::VirtualAttributes::Serialization

Extended by:
ActiveSupport::Concern
Defined in:
lib/active_type/virtual_attributes.rb

Instance Method Summary collapse

Instance Method Details

#encode_with(coder) ⇒ Object



21
22
23
24
25
# File 'lib/active_type/virtual_attributes.rb', line 21

def encode_with(coder)
  coder['virtual_attributes'] = @virtual_attributes
  coder['active_type_yaml_version'] = 1
  super(coder)
end

#init_with(coder) ⇒ Object



14
15
16
17
18
19
# File 'lib/active_type/virtual_attributes.rb', line 14

def init_with(coder)
  if coder['virtual_attributes'].present?
    @virtual_attributes = coder['virtual_attributes']
  end
  super(coder)
end