Class: Conreality::Event

Inherits:
Database::Row show all
Defined in:
lib/conreality/event.rb

Overview

Represents a Conreality event.

Constant Summary collapse

TABLE =
:event
KEY =
:id

Constants inherited from Database::Row

Database::Row::SCHEMA

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Database::Row

attr_accessor, attr_reader, attr_wrapper, attr_writer, #get, #key, key_attr, #set!, table_name

Constructor Details

#initialize(client, id) ⇒ Event

Returns a new instance of Event.

Parameters:


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

def initialize(client, id)
  super(client)
  @id = id.to_i
end

Instance Attribute Details

#idInteger (readonly)

The event's sequential identifier.

Returns:

  • (Integer)

12
13
14
# File 'lib/conreality/event.rb', line 12

def id
  @id
end

#objectObject (readonly)

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

Returns:


37
38
39
# File 'lib/conreality/event.rb', line 37

def object
  @object
end

#predicateString (readonly)

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

Returns:

  • (String)

24
25
26
# File 'lib/conreality/event.rb', line 24

def predicate
  @predicate
end

#subjectObject (readonly)

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

Returns:


30
31
32
# File 'lib/conreality/event.rb', line 30

def subject
  @subject
end

#timestampTime (readonly)

The event's timestamp (in Zulu time).

Returns:

  • (Time)

18
19
20
# File 'lib/conreality/event.rb', line 18

def timestamp
  @timestamp
end

Instance Method Details

#inspectString

Returns a developer-friendly representation of this event.

Returns:

  • (String)

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

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