Class: Vines::Stream::State
- Inherits:
-
Object
- Object
- Vines::Stream::State
- Defined in:
- lib/vines/stream/state.rb
Overview
The base class of Stream state machines. States know how to process XML nodes and advance to their next valid state or fail the stream.
Direct Known Subclasses
Client::Auth, Client::AuthRestart, Client::Bind, Client::BindRestart, Client::Closed, Client::Ready, Client::Start, Client::TLS, Component::Handshake, Component::Ready, Component::Start, Http::BindRestart, Http::Start, Vines::Stream::Server::AuthMethod, Vines::Stream::Server::AuthRestart, Vines::Stream::Server::FinalRestart, Vines::Stream::Server::Outbound::Auth, Vines::Stream::Server::Outbound::AuthDialbackResult, Vines::Stream::Server::Outbound::AuthExternal, Vines::Stream::Server::Outbound::AuthExternalResult, Vines::Stream::Server::Outbound::AuthRestart, Vines::Stream::Server::Outbound::Authoritative, Vines::Stream::Server::Outbound::FinalFeatures, Vines::Stream::Server::Outbound::FinalRestart, Vines::Stream::Server::Outbound::Start, Vines::Stream::Server::Outbound::TLSResult, Vines::Stream::Server::Ready, Vines::Stream::Server::Start
Constant Summary
Constants included from Node
Instance Attribute Summary collapse
-
#stream ⇒ Object
Returns the value of attribute stream.
Instance Method Summary collapse
- #==(state) ⇒ Object
- #eql?(state) ⇒ Boolean
- #hash ⇒ Object
-
#initialize(stream, success = nil) ⇒ State
constructor
A new instance of State.
- #node(node) ⇒ Object
Methods included from Node
body?, namespace, stream?, to_stanza
Methods included from Log
Constructor Details
#initialize(stream, success = nil) ⇒ State
Returns a new instance of State.
15 16 17 |
# File 'lib/vines/stream/state.rb', line 15 def initialize(stream, success=nil) @stream, @success = stream, success end |
Instance Attribute Details
#stream ⇒ Object
Returns the value of attribute stream.
13 14 15 |
# File 'lib/vines/stream/state.rb', line 13 def stream @stream end |
Instance Method Details
#==(state) ⇒ Object
23 24 25 |
# File 'lib/vines/stream/state.rb', line 23 def ==(state) self.class == state.class end |
#eql?(state) ⇒ Boolean
27 28 29 |
# File 'lib/vines/stream/state.rb', line 27 def eql?(state) state.is_a?(State) && self == state end |
#hash ⇒ Object
31 32 33 |
# File 'lib/vines/stream/state.rb', line 31 def hash self.class.hash end |
#node(node) ⇒ Object
19 20 21 |
# File 'lib/vines/stream/state.rb', line 19 def node(node) raise 'subclass must implement' end |