Class: Vines::Stream::Server::Outbound::AuthResult
- Inherits:
-
Vines::Stream::State
- Object
- Vines::Stream::State
- Vines::Stream::Server::Outbound::AuthResult
- Defined in:
- lib/vines/stream/server/outbound/auth_result.rb
Constant Summary collapse
- SUCCESS =
'success'.freeze
- FAILURE =
'failure'.freeze
Constants inherited from Vines::Stream::State
Vines::Stream::State::BODY, Vines::Stream::State::STREAM
Instance Attribute Summary
Attributes inherited from Vines::Stream::State
Instance Method Summary collapse
-
#initialize(stream, success = FinalRestart) ⇒ AuthResult
constructor
A new instance of AuthResult.
- #node(node) ⇒ Object
Methods inherited from Vines::Stream::State
Methods included from Log
Constructor Details
#initialize(stream, success = FinalRestart) ⇒ AuthResult
Returns a new instance of AuthResult.
11 12 13 |
# File 'lib/vines/stream/server/outbound/auth_result.rb', line 11 def initialize(stream, success=FinalRestart) super end |
Instance Method Details
#node(node) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/vines/stream/server/outbound/auth_result.rb', line 15 def node(node) raise StreamErrors::NotAuthorized unless namespace(node) == NAMESPACES[:sasl] case node.name when SUCCESS stream.start(node) stream.reset advance when FAILURE stream.close_connection else raise StreamErrors::NotAuthorized end end |