Class: Tep::PresenceEntry

Inherits:
Object
  • Object
show all
Defined in:
lib/tep/presence_entry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(topic, principal_id, kind, agent_id, fd, since) ⇒ PresenceEntry

Returns a new instance of PresenceEntry.



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/tep/presence_entry.rb', line 40

def initialize(topic, principal_id, kind, agent_id, fd, since)
  @topic         = topic
  @principal_id  = principal_id
  @kind          = kind
  @agent_id      = agent_id
  @fd            = fd
  @since         = since
  @status_state  = :available
  @status_note   = ""
  @status_until  = 0
end

Instance Attribute Details

#agent_idObject (readonly)

String, empty when kind == :human



31
32
33
# File 'lib/tep/presence_entry.rb', line 31

def agent_id
  @agent_id
end

#fdObject (readonly)

Integer, session-id surrogate



32
33
34
# File 'lib/tep/presence_entry.rb', line 32

def fd
  @fd
end

#kindObject (readonly)

Symbol: :human | :agent_for



30
31
32
# File 'lib/tep/presence_entry.rb', line 30

def kind
  @kind
end

#principal_idObject (readonly)

String, opaque



29
30
31
# File 'lib/tep/presence_entry.rb', line 29

def principal_id
  @principal_id
end

#sinceObject (readonly)

Integer unix epoch seconds



33
34
35
# File 'lib/tep/presence_entry.rb', line 33

def since
  @since
end

#status_noteObject

Returns the value of attribute status_note.



37
38
39
# File 'lib/tep/presence_entry.rb', line 37

def status_note
  @status_note
end

#status_stateObject

Structured-status fields (see docs/BATTERIES-DESIGN.md + memory presence_status). state ∈ :available | :busy | :blocked.



36
37
38
# File 'lib/tep/presence_entry.rb', line 36

def status_state
  @status_state
end

#status_untilObject

Returns the value of attribute status_until.



38
39
40
# File 'lib/tep/presence_entry.rb', line 38

def status_until
  @status_until
end

#topicObject (readonly)

String



28
29
30
# File 'lib/tep/presence_entry.rb', line 28

def topic
  @topic
end