Class: WolfCore::Entity

Inherits:
DomainObject show all
Defined in:
lib/wolf_core/domain/entity.rb

Instance Method Summary collapse

Methods inherited from DomainObject

#attributes, #attributes=, cast, cast_all, create, create_all, define_attributes, extract_success_key, #initialize, #parse_attributes, parse_params, #reset_changes, #valid?

Constructor Details

This class inherits a constructor from WolfCore::DomainObject

Instance Method Details

#==(other) ⇒ Object



12
13
14
# File 'lib/wolf_core/domain/entity.rb', line 12

def ==(other)
  id == other.id
end

#created_atObject



16
17
18
19
20
21
# File 'lib/wolf_core/domain/entity.rb', line 16

def created_at
  return if id.blank?

  timestamp = id.split('-')[1].to_i
  @created_at ||= Time.at(timestamp).utc
end