Class: Akasha::Event
- Inherits:
-
Object
- Object
- Akasha::Event
- Defined in:
- lib/akasha/event.rb
Overview
Event contains all information pertaining to a single event recorded by the system.
Instance Attribute Summary collapse
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name, created_at = Time.now.utc, **data) ⇒ Event
constructor
A new instance of Event.
- #metadata ⇒ Object
Constructor Details
#initialize(name, created_at = Time.now.utc, **data) ⇒ Event
Returns a new instance of Event.
9 10 11 12 13 |
# File 'lib/akasha/event.rb', line 9 def initialize(name, created_at = Time.now.utc, **data) @name = name @created_at = created_at @data = data end |
Instance Attribute Details
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at.
7 8 9 |
# File 'lib/akasha/event.rb', line 7 def created_at @created_at end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
7 8 9 |
# File 'lib/akasha/event.rb', line 7 def data @data end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/akasha/event.rb', line 7 def name @name end |
Instance Method Details
#==(other) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/akasha/event.rb', line 21 def ==(other) self.class == other.class && name == other.name && data == other.data && created_at == other.created_at end |
#metadata ⇒ Object
15 16 17 18 19 |
# File 'lib/akasha/event.rb', line 15 def { created_at: @created_at } end |