Class: Blather::Stream::Resource
- Inherits:
-
Features
- Object
- Features
- Blather::Stream::Resource
- Defined in:
- lib/blather/stream/features/resource.rb
Constant Summary
- BIND_NS =
'urn:ietf:params:xml:ns:xmpp-bind'.freeze
Instance Method Summary (collapse)
-
- (Resource) initialize(stream, succeed, fail)
constructor
A new instance of Resource.
- - (Object) receive_data(stanza)
Methods inherited from Features
#fail!, #feature?, from_namespace, #next!, register, #succeed!
Constructor Details
- (Resource) initialize(stream, succeed, fail)
A new instance of Resource
9 10 11 12 |
# File 'lib/blather/stream/features/resource.rb', line 9 def initialize(stream, succeed, fail) super @jid = stream.jid end |
Instance Method Details
- (Object) receive_data(stanza)
14 15 16 17 18 19 20 21 |
# File 'lib/blather/stream/features/resource.rb', line 14 def receive_data(stanza) @node = stanza case stanza.element_name when 'bind' then bind when 'iq' then result else fail!(UnknownResponse.new(@node)) end end |