Class: Blather::Stanza
- Defined in:
- lib/punchblock/core_ext/blather/stanza.rb,
lib/punchblock/core_ext/blather/stanza/presence.rb
Defined Under Namespace
Classes: Presence
Constant Summary collapse
- RAYO_NODE_PATH =
"(#{Punchblock::RAYO_NAMESPACES.keys.map { |k| "#{k}:*" }.join("|")})".freeze
Instance Method Summary collapse
-
#call_id ⇒ String
The call ID this stanza applies to.
-
#component_id ⇒ String
The command ID this stanza applies to.
-
#rayo_node ⇒ Punchblock::RayoNode
A child of RayoNode representing the Rayo command/event contained within the stanza.
Instance Method Details
#call_id ⇒ String
Returns the call ID this stanza applies to.
20 21 22 |
# File 'lib/punchblock/core_ext/blather/stanza.rb', line 20 def call_id from.node end |
#component_id ⇒ String
Returns the command ID this stanza applies to.
27 28 29 |
# File 'lib/punchblock/core_ext/blather/stanza.rb', line 27 def component_id from.resource end |
#rayo_node ⇒ Punchblock::RayoNode
Returns a child of RayoNode representing the Rayo command/event contained within the stanza.
10 11 12 13 14 15 |
# 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}", if first_child end end |