Class: Mole::Event
- Inherits:
-
Object
- Object
- Mole::Event
- Defined in:
- lib/orwell/mole/event.rb
Instance Attribute Summary collapse
-
#details ⇒ Object
Returns the value of attribute details.
-
#event ⇒ Object
Returns the value of attribute event.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(event, details = {}) ⇒ Event
constructor
A new instance of Event.
- #to_h ⇒ Object
Constructor Details
#initialize(event, details = {}) ⇒ Event
Returns a new instance of Event.
5 6 7 8 9 |
# File 'lib/orwell/mole/event.rb', line 5 def initialize(event, details = {}) @event = event @details = details @timestamp = Time.now.utc.to_i end |
Instance Attribute Details
#details ⇒ Object
Returns the value of attribute details.
3 4 5 |
# File 'lib/orwell/mole/event.rb', line 3 def details @details end |
#event ⇒ Object
Returns the value of attribute event.
3 4 5 |
# File 'lib/orwell/mole/event.rb', line 3 def event @event end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
3 4 5 |
# File 'lib/orwell/mole/event.rb', line 3 def @timestamp end |
Instance Method Details
#to_h ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/orwell/mole/event.rb', line 11 def to_h { event: event, details: details, timestamp: } end |