Class: Vines::Stream::Http::Bind

Inherits:
Client::Bind show all
Defined in:
lib/vines/stream/http/bind.rb

Constant Summary collapse

FEATURES =
%Q{<stream:features xmlns:stream="#{NAMESPACES[:stream]}"/>}.freeze

Constants inherited from Client::Bind

Client::Bind::MAX_ATTEMPTS, Client::Bind::NS

Constants inherited from State

State::BODY, State::STREAM

Instance Attribute Summary

Attributes inherited from State

#stream

Instance Method Summary collapse

Methods inherited from State

#==, #eql?, #hash

Methods included from Log

#log

Constructor Details

#initialize(stream, success = Ready) ⇒ Bind

Returns a new instance of Bind.



9
10
11
# File 'lib/vines/stream/http/bind.rb', line 9

def initialize(stream, success=Ready)
  super
end

Instance Method Details

#node(node) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/vines/stream/http/bind.rb', line 13

def node(node)
  unless stream.valid_session?(node['sid']) && body?(node) && node['rid']
    raise StreamErrors::NotAuthorized
  end
  nodes = stream.parse_body(node)
  raise StreamErrors::NotAuthorized unless nodes.size == 1
  super(nodes.first)
end