Class: Vines::Stream::Http::BindRestart
- Defined in:
- lib/vines/stream/http/bind_restart.rb
Constant Summary
Constants inherited from State
Instance Attribute Summary
Attributes inherited from State
Instance Method Summary collapse
-
#initialize(stream, success = Bind) ⇒ BindRestart
constructor
A new instance of BindRestart.
- #node(node) ⇒ Object
Methods inherited from State
Methods included from Log
Constructor Details
#initialize(stream, success = Bind) ⇒ BindRestart
Returns a new instance of BindRestart.
7 8 9 |
# File 'lib/vines/stream/http/bind_restart.rb', line 7 def initialize(stream, success=Bind) super end |
Instance Method Details
#node(node) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/vines/stream/http/bind_restart.rb', line 11 def node(node) raise StreamErrors::NotAuthorized unless restart?(node) doc = Document.new body = doc.create_element('body') do |el| el.add_namespace(nil, NAMESPACES[:http_bind]) el.add_namespace('stream', NAMESPACES[:stream]) el << doc.create_element('stream:features') do |features| features << doc.create_element('bind', 'xmlns' => NAMESPACES[:bind]) end end stream.reply(body) advance end |