Class: Conreality::Event
- Inherits:
-
Object
- Object
- Conreality::Event
- Defined in:
- lib/conreality/event.rb
Overview
Represents a Conreality event.
Constant Summary collapse
- TABLE =
:event- KEY =
:id
Instance Attribute Summary collapse
-
#id ⇒ Integer
readonly
The event’s sequential identifier.
-
#object ⇒ Object
readonly
The object (i.e., target) of the predicate.
-
#predicate ⇒ Symbol
readonly
The event’s predicate (an action or verb).
-
#subject ⇒ Object
readonly
The subject (i.e., source) of the predicate.
-
#timestamp ⇒ Time
readonly
The event’s timestamp (in Zulu time).
Instance Method Summary collapse
-
#initialize(session, id) ⇒ Event
constructor
A new instance of Event.
-
#inspect ⇒ String
Returns a developer-friendly representation of this event.
Constructor Details
#initialize(session, id) ⇒ Event
Returns a new instance of Event.
45 46 47 |
# File 'lib/conreality/event.rb', line 45 def initialize(session, id) @session, @id = session, id.to_i end |
Instance Attribute Details
#id ⇒ Integer (readonly)
The event’s sequential identifier.
14 15 16 |
# File 'lib/conreality/event.rb', line 14 def id @id end |
#object ⇒ Object (readonly)
The object (i.e., target) of the predicate.
39 40 41 |
# File 'lib/conreality/event.rb', line 39 def object @object end |
#predicate ⇒ Symbol (readonly)
The event’s predicate (an action or verb).
26 27 28 |
# File 'lib/conreality/event.rb', line 26 def predicate @predicate end |
#subject ⇒ Object (readonly)
The subject (i.e., source) of the predicate.
32 33 34 |
# File 'lib/conreality/event.rb', line 32 def subject @subject end |
#timestamp ⇒ Time (readonly)
The event’s timestamp (in Zulu time).
20 21 22 |
# File 'lib/conreality/event.rb', line 20 def @timestamp end |
Instance Method Details
#inspect ⇒ String
Returns a developer-friendly representation of this event.
53 54 55 |
# File 'lib/conreality/event.rb', line 53 def inspect sprintf("#<%s:%#0x(id: %s)>", self.class.name, self.__id__, @id) end |