Class: Vines::Stream::Http::Start

Inherits:
State
  • Object
show all
Defined in:
lib/vines/stream/http/start.rb

Constant Summary

Constants included from Node

Node::BODY, Node::STREAM

Instance Attribute Summary

Attributes inherited from State

#stream

Instance Method Summary collapse

Methods inherited from State

#==, #eql?, #hash

Methods included from Node

body?, namespace, stream?, to_stanza

Methods included from Log

#log, set_log_file

Constructor Details

#initialize(stream, success = Auth) ⇒ Start

Returns a new instance of Start.



7
8
9
# File 'lib/vines/stream/http/start.rb', line 7

def initialize(stream, success=Auth)
  super
end

Instance Method Details

#node(node) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/vines/stream/http/start.rb', line 11

def node(node)
  raise StreamErrors::NotAuthorized unless body?(node)
  if session = Sessions[node['sid']]
    session.resume(stream, node)
  else
    stream.start(node)
    advance
  end
end