Class: Akasha::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/akasha/event.rb

Overview

Event contains all information pertaining to a single event recorded by the system.

Instance Attribute Summary collapse

Instance Method Summary collapse

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_atObject (readonly)

Returns the value of attribute created_at.



7
8
9
# File 'lib/akasha/event.rb', line 7

def created_at
  @created_at
end

#dataObject (readonly)

Returns the value of attribute data.



7
8
9
# File 'lib/akasha/event.rb', line 7

def data
  @data
end

#nameObject (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

#metadataObject



15
16
17
18
19
# File 'lib/akasha/event.rb', line 15

def 
  {
    created_at: @created_at
  }
end