Module: Arkenstone::Timestamps::InstanceMethods

Defined in:
lib/arkenstone/timestamps.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#created_atObject

Returns the value of attribute created_at.



12
13
14
# File 'lib/arkenstone/timestamps.rb', line 12

def created_at
  @created_at
end

#updated_atObject

Returns the value of attribute updated_at.



12
13
14
# File 'lib/arkenstone/timestamps.rb', line 12

def updated_at
  @updated_at
end

Instance Method Details

#timestampObject



18
19
20
21
22
# File 'lib/arkenstone/timestamps.rb', line 18

def timestamp
  current_time = Time.now
  self.created_at = current_time unless created_at
  self.updated_at = current_time
end

#timestampableObject



14
15
16
# File 'lib/arkenstone/timestamps.rb', line 14

def timestampable
  true
end