Class: Vines::Stream::Server::Outbound::AuthDialbackResult

Inherits:
Vines::Stream::State show all
Defined in:
lib/vines/stream/server/outbound/auth_dialback_result.rb

Constant Summary

Constants included from Node

Node::BODY, Node::STREAM

Instance Attribute Summary collapse

Attributes inherited from Vines::Stream::State

#stream

Instance Method Summary collapse

Methods inherited from Vines::Stream::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 = Ready) ⇒ AuthDialbackResult

Returns a new instance of AuthDialbackResult.



12
13
14
# File 'lib/vines/stream/server/outbound/auth_dialback_result.rb', line 12

def initialize(stream, success=Ready)
  super
end

Instance Attribute Details

#dialback_secretObject

Returns the value of attribute dialback_secret.



10
11
12
# File 'lib/vines/stream/server/outbound/auth_dialback_result.rb', line 10

def dialback_secret
  @dialback_secret
end

Instance Method Details

#node(node) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/vines/stream/server/outbound/auth_dialback_result.rb', line 16

def node(node)
  raise StreamErrors::NotAuthorized unless result?(node)

  case node[TYPE]
  when VALID
    advance
    stream.notify_connected
  when INVALID
    stream.close_connection
  else
    raise StreamErrors::NotAuthorized
  end
end