Module: GdatastoreMapper::Base

Extended by:
ActiveSupport::Concern
Includes:
ActiveModel::Callbacks, ActiveModel::Model, ActiveModel::Validations, ActiveModel::Validations::Callbacks
Defined in:
lib/gdatastore_mapper/base.rb

Defined Under Namespace

Modules: ClassMethods

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



16
17
18
# File 'lib/gdatastore_mapper/base.rb', line 16

def created_at
  @created_at
end

#idObject

Returns the value of attribute id.



16
17
18
# File 'lib/gdatastore_mapper/base.rb', line 16

def id
  @id
end

#updated_atObject

Returns the value of attribute updated_at.



16
17
18
# File 'lib/gdatastore_mapper/base.rb', line 16

def updated_at
  @updated_at
end

Instance Method Details

#attributesObject



52
53
54
# File 'lib/gdatastore_mapper/base.rb', line 52

def attributes
  self.class.attributes
end

#to_entityObject



56
57
58
59
60
61
62
# File 'lib/gdatastore_mapper/base.rb', line 56

def to_entity
  entity_timestamp
  attributes.each do |attribute|
    @entity[attribute] = self.send attribute if self.send attribute
  end
  @entity
end