Method: Dynamoid::Persistence#dump

Defined in:
lib/dynamoid/persistence.rb

#dumpObject

Dump this object’s attributes into hash form, fit to be persisted into the datastore.

Since:

  • 0.2.0



370
371
372
373
374
375
376
# File 'lib/dynamoid/persistence.rb', line 370

def dump
  Hash.new.tap do |hash|
    self.class.attributes.each do |attribute, options|
      hash[attribute] = dump_field(self.read_attribute(attribute), options)
    end
  end
end