Class: Conreality::Event

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

Overview

Represents a Conreality event.

Constant Summary collapse

TABLE =
:event
KEY =
:id

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(session, id) ⇒ Event

Returns a new instance of Event.

Parameters:



45
46
47
# File 'lib/conreality/event.rb', line 45

def initialize(session, id)
  @session, @id = session, id.to_i
end

Instance Attribute Details

#idInteger (readonly)

The event’s sequential identifier.

Returns:

  • (Integer)


14
15
16
# File 'lib/conreality/event.rb', line 14

def id
  @id
end

#objectObject (readonly)

The object (i.e., target) of the predicate.

Returns:



39
40
41
# File 'lib/conreality/event.rb', line 39

def object
  @object
end

#predicateSymbol (readonly)

The event’s predicate (an action or verb).

Returns:

  • (Symbol)


26
27
28
# File 'lib/conreality/event.rb', line 26

def predicate
  @predicate
end

#subjectObject (readonly)

The subject (i.e., source) of the predicate.

Returns:



32
33
34
# File 'lib/conreality/event.rb', line 32

def subject
  @subject
end

#timestampTime (readonly)

The event’s timestamp (in Zulu time).

Returns:

  • (Time)


20
21
22
# File 'lib/conreality/event.rb', line 20

def timestamp
  @timestamp
end

Instance Method Details

#inspectString

Returns a developer-friendly representation of this event.

Returns:

  • (String)


53
54
55
# File 'lib/conreality/event.rb', line 53

def inspect
  sprintf("#<%s:%#0x(id: %s)>", self.class.name, self.__id__, @id)
end