Module: Dynamo::Record::Model::InstanceMethods

Defined in:
lib/dynamo/record/model.rb

Instance Method Summary collapse

Instance Method Details

#attribute_hashObject



119
120
121
122
123
124
125
126
127
128
# File 'lib/dynamo/record/model.rb', line 119

def attribute_hash
  attrs = self.class.attributes.attributes
  attr_keys = attrs.keys
  hash = {}

  attr_keys.each do |key|
    hash[key] = attrs[key].type_cast(send(key))
  end
  hash
end

#read_attribute_for_serialization(attribute) ⇒ Object



115
116
117
# File 'lib/dynamo/record/model.rb', line 115

def read_attribute_for_serialization(attribute)
  send(attribute)
end