Class: Punchblock::Ref

Inherits:
RayoNode show all
Defined in:
lib/punchblock/ref.rb

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

- (Object) call_id



22
23
24
25
26
27
28
29
30
31
# File 'lib/punchblock/ref.rb', line 22

def call_id
  case scheme
  when 'xmpp'
    RubyJID.new(uri.opaque).node
  when nil
    uri.path
  else
    uri.opaque
  end
end

- (Object) component_id



40
41
42
43
44
45
46
47
# File 'lib/punchblock/ref.rb', line 40

def component_id
  case scheme
  when 'xmpp'
    RubyJID.new(uri.opaque).resource
  else
    call_id
  end
end

- (Object) domain



33
34
35
36
37
38
# File 'lib/punchblock/ref.rb', line 33

def domain
  case scheme
  when 'xmpp'
    RubyJID.new(uri.opaque).domain
  end
end

- (Object) rayo_attributes



49
50
51
52
53
# File 'lib/punchblock/ref.rb', line 49

def rayo_attributes
  {}.tap do |atts|
    atts[:uri] = uri if uri
  end
end

- (Object) scheme



18
19
20
# File 'lib/punchblock/ref.rb', line 18

def scheme
  uri.scheme
end

- (String) uri



13
# File 'lib/punchblock/ref.rb', line 13

attribute :uri

- (Object) uri=(other)



14
15
16
# File 'lib/punchblock/ref.rb', line 14

def uri=(other)
  super URI(other)
end