Class: Adhearsion::Rayo::Ref
Overview
A rayo Ref message. This provides the command ID in response to execution of a command.
Instance Attribute Summary
Attributes inherited from RayoNode
#client, #connection, #original_component
Instance Method Summary
collapse
Methods inherited from RayoNode
#==, class_from_registration, from_xml, #inherit, #inspect, #rayo_children, register, #source, #to_rayo, #to_xml
Instance Method Details
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/adhearsion/rayo/ref.rb', line 23
def call_id
case scheme
when 'xmpp'
RubyJID.new(uri.opaque).node
when nil
uri.path
else
uri.opaque
end
end
|
#component_id ⇒ Object
41
42
43
44
45
46
47
48
|
# File 'lib/adhearsion/rayo/ref.rb', line 41
def component_id
case scheme
when 'xmpp'
RubyJID.new(uri.opaque).resource
else
call_id
end
end
|
34
35
36
37
38
39
|
# File 'lib/adhearsion/rayo/ref.rb', line 34
def domain
case scheme
when 'xmpp'
RubyJID.new(uri.opaque).domain
end
end
|
#rayo_attributes ⇒ Object
50
51
52
53
54
|
# File 'lib/adhearsion/rayo/ref.rb', line 50
def rayo_attributes
{}.tap do |atts|
atts[:uri] = uri if uri
end
end
|
19
20
21
|
# File 'lib/adhearsion/rayo/ref.rb', line 19
def scheme
uri.scheme
end
|
#uri ⇒ String
14
|
# File 'lib/adhearsion/rayo/ref.rb', line 14
attribute :uri
|
#uri=(other) ⇒ Object
15
16
17
|
# File 'lib/adhearsion/rayo/ref.rb', line 15
def uri=(other)
super URI(other)
end
|