class Blather::Stanza

Constants

RAYO_NODE_PATH

Public Instance Methods

call_id() click to toggle source

@return [String] the call ID this stanza applies to

# File lib/punchblock/core_ext/blather/stanza.rb, line 20
def call_id
  from.node
end
component_id() click to toggle source

@return [String] the command ID this stanza applies to

# File lib/punchblock/core_ext/blather/stanza.rb, line 27
def component_id
  from.resource
end
rayo_node() click to toggle source

@return [Punchblock::RayoNode] a child of RayoNode

representing the Rayo command/event contained within the stanza
# File lib/punchblock/core_ext/blather/stanza.rb, line 10
def rayo_node
  @rayo_node ||= begin
    first_child = at_xpath RAYO_NODE_PATH, Punchblock::RAYO_NAMESPACES
    Punchblock::RayoNode.from_xml first_child, nil, component_id, "xmpp:#{from}", delay_timestamp if first_child
  end
end

Private Instance Methods

delay_timestamp() click to toggle source
# File lib/punchblock/core_ext/blather/stanza.rb, line 33
def delay_timestamp
  if delay = self.at_xpath('ns:delay', ns: 'urn:xmpp:delay')
    DateTime.parse(delay[:stamp])
  end
end