Class: Blather::Stanza

Inherits:
Object show all
Defined in:
lib/punchblock/core_ext/blather/stanza.rb,
lib/punchblock/core_ext/blather/stanza/presence.rb

Defined Under Namespace

Classes: Presence

Instance Method Summary collapse

Instance Method Details

#call_idString

Returns the call ID this stanza applies to.

Returns:

  • (String)

    the call ID this stanza applies to



19
20
21
# File 'lib/punchblock/core_ext/blather/stanza.rb', line 19

def call_id
  from.node
end

#component_idString

Returns the command ID this stanza applies to.

Returns:

  • (String)

    the command ID this stanza applies to



26
27
28
# File 'lib/punchblock/core_ext/blather/stanza.rb', line 26

def component_id
  from.resource
end

#rayo_nodePunchblock::RayoNode

Returns a child of RayoNode representing the Rayo command/event contained within the stanza.

Returns:

  • (Punchblock::RayoNode)

    a child of RayoNode representing the Rayo command/event contained within the stanza



9
10
11
12
13
14
# File 'lib/punchblock/core_ext/blather/stanza.rb', line 9

def rayo_node
  first_child = at_xpath '*'
  Punchblock::RayoNode.import first_child, nil, component_id if first_child
rescue Punchblock::RayoNode::InvalidNodeError
  nil
end