Class: Jabber::Bytestreams::StreamHost
- Inherits:
-
XMPPElement
- Object
- REXML::Element
- XMPPElement
- Jabber::Bytestreams::StreamHost
- Defined in:
- lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/iq/bytestreams.rb
Overview
<streamhost/> element, normally appear as children of IqQueryBytestreams
Direct Known Subclasses
Instance Method Summary collapse
-
#host ⇒ Object
Get the host address of the streamhost.
-
#host=(h) ⇒ Object
Set the host address of the streamhost.
-
#initialize(jid = nil, host = nil, port = nil) ⇒ StreamHost
constructor
- Initialize a <streamhost/> element jid
- JID
- host
- String
- Hostname or IP address port
- Fixnum
-
Port number.
-
#jid ⇒ Object
Get the JID of the streamhost.
-
#jid=(j) ⇒ Object
Set the JID of the streamhost.
-
#port ⇒ Object
Get the port number of the streamhost.
-
#port=(p) ⇒ Object
Set the port number of the streamhost.
-
#zeroconf ⇒ Object
Get the zeroconf attribute of the streamhost.
-
#zeroconf=(s) ⇒ Object
Set the zeroconf attribute of the streamhost.
Methods inherited from XMPPElement
class_for_name_xmlns, #clone, force_xmlns, force_xmlns?, import, name_xmlns, name_xmlns_for_class, #parent=, #set_xml_lang, #typed_add, #xml_lang, #xml_lang=
Methods inherited from REXML::Element
#==, #delete_elements, #first_element, #first_element_text, #import, import, #replace_element_text, #typed_add
Constructor Details
#initialize(jid = nil, host = nil, port = nil) ⇒ StreamHost
Initialize a <streamhost/> element
- jid
- JID
- host
- String
-
Hostname or IP address
- port
- Fixnum
-
Port number
93 94 95 96 97 98 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/iq/bytestreams.rb', line 93 def initialize(jid=nil, host=nil, port=nil) super() self.jid = jid self.host = host self.port = port end |
Instance Method Details
#host ⇒ Object
Get the host address of the streamhost
114 115 116 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/iq/bytestreams.rb', line 114 def host attributes['host'] end |
#host=(h) ⇒ Object
Set the host address of the streamhost
120 121 122 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/iq/bytestreams.rb', line 120 def host=(h) attributes['host'] = h end |
#jid ⇒ Object
Get the JID of the streamhost
102 103 104 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/iq/bytestreams.rb', line 102 def jid (a = attributes['jid']) ? JID.new(a) : nil end |
#jid=(j) ⇒ Object
Set the JID of the streamhost
108 109 110 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/iq/bytestreams.rb', line 108 def jid=(j) attributes['jid'] = (j ? j.to_s : nil) end |
#port ⇒ Object
Get the port number of the streamhost
138 139 140 141 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/iq/bytestreams.rb', line 138 def port p = attributes['port'].to_i (p == 0 ? nil : p) end |
#port=(p) ⇒ Object
Set the port number of the streamhost
145 146 147 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/iq/bytestreams.rb', line 145 def port=(p) attributes['port'] = p.to_s end |
#zeroconf ⇒ Object
Get the zeroconf attribute of the streamhost
126 127 128 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/iq/bytestreams.rb', line 126 def zeroconf attributes['zeroconf'] end |
#zeroconf=(s) ⇒ Object
Set the zeroconf attribute of the streamhost
132 133 134 |
# File 'lib/vendor/xmpp4r/lib/xmpp4r/bytestreams/iq/bytestreams.rb', line 132 def zeroconf=(s) attributes['zeroconf'] = s end |