Class: PuppetEditorServices::Protocol::Base
- Inherits:
-
Object
- Object
- PuppetEditorServices::Protocol::Base
- Defined in:
- lib/puppet_editor_services/protocol/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
Instance Method Summary collapse
- #close_connection ⇒ Object
- #connection_error? ⇒ Boolean
-
#initialize(connection) ⇒ Base
constructor
A new instance of Base.
- #receive_data(data) ⇒ Object abstract
Constructor Details
#initialize(connection) ⇒ Base
Returns a new instance of Base.
8 9 10 11 |
# File 'lib/puppet_editor_services/protocol/base.rb', line 8 def initialize(connection) @connection = connection @handler = connection.server.[:class].new(self) end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
6 7 8 |
# File 'lib/puppet_editor_services/protocol/base.rb', line 6 def connection @connection end |
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
6 7 8 |
# File 'lib/puppet_editor_services/protocol/base.rb', line 6 def handler @handler end |
Instance Method Details
#close_connection ⇒ Object
16 17 18 |
# File 'lib/puppet_editor_services/protocol/base.rb', line 16 def close_connection connection.close unless connection.nil? end |
#connection_error? ⇒ Boolean
20 21 22 23 24 |
# File 'lib/puppet_editor_services/protocol/base.rb', line 20 def connection_error? return false if connection.nil? connection.error? end |
#receive_data(data) ⇒ Object
This method is abstract.
14 |
# File 'lib/puppet_editor_services/protocol/base.rb', line 14 def receive_data(data); end |