Class: Vines::Stream::State
- Inherits:
-
Object
- Object
- Vines::Stream::State
- Includes:
- Nokogiri::XML, Log
- 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::FinalRestart, Vines::Stream::Server::Outbound::Auth, Vines::Stream::Server::Outbound::AuthRestart, Vines::Stream::Server::Outbound::AuthResult, Vines::Stream::Server::Outbound::FinalFeatures, Vines::Stream::Server::Outbound::FinalRestart, Vines::Stream::Server::Outbound::Start, Vines::Stream::Server::Outbound::TLS, Vines::Stream::Server::Outbound::TLSResult, Vines::Stream::Server::Ready
Constant Summary collapse
- BODY =
'body'.freeze
- STREAM =
'stream'.freeze
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 Log
Constructor Details
#initialize(stream, success = nil) ⇒ State
Returns a new instance of State.
17 18 19 |
# File 'lib/vines/stream/state.rb', line 17 def initialize(stream, success=nil) @stream, @success = stream, success end |
Instance Attribute Details
#stream ⇒ Object
Returns the value of attribute stream.
12 13 14 |
# File 'lib/vines/stream/state.rb', line 12 def stream @stream end |
Instance Method Details
#==(state) ⇒ Object
25 26 27 |
# File 'lib/vines/stream/state.rb', line 25 def ==(state) self.class == state.class end |
#eql?(state) ⇒ Boolean
29 30 31 |
# File 'lib/vines/stream/state.rb', line 29 def eql?(state) state.is_a?(State) && self == state end |
#hash ⇒ Object
33 34 35 |
# File 'lib/vines/stream/state.rb', line 33 def hash self.class.hash end |
#node(node) ⇒ Object
21 22 23 |
# File 'lib/vines/stream/state.rb', line 21 def node(node) raise 'subclass must implement' end |