Class: KJess::Response::Value
- Inherits:
-
KJess::Response
- Object
- Protocol
- KJess::Response
- KJess::Response::Value
- Defined in:
- lib/kjess/response/value.rb
Constant Summary
Constants inherited from KJess::Response
Constants inherited from Protocol
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
Attributes inherited from Protocol
Instance Method Summary collapse
- #bytes ⇒ Object
- #flags ⇒ Object
- #queue ⇒ Object
-
#read_more(connection) ⇒ Object
Internal: Read the extra data from the value.
Methods inherited from KJess::Response
#error?, #message, parse, #parse_options_to_args, registry
Methods inherited from Protocol
arity, #initialize, keyword, #keyword, #parse_options_to_args, register, #to_protocol
Constructor Details
This class inherits a constructor from KJess::Protocol
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
6 7 8 |
# File 'lib/kjess/response/value.rb', line 6 def data @data end |
Instance Method Details
#bytes ⇒ Object
10 |
# File 'lib/kjess/response/value.rb', line 10 def bytes; args[2].to_i; end |
#flags ⇒ Object
9 |
# File 'lib/kjess/response/value.rb', line 9 def flags; args[1].to_i; end |
#queue ⇒ Object
8 |
# File 'lib/kjess/response/value.rb', line 8 def queue; args[0]; end |
#read_more(connection) ⇒ Object
Internal: Read the extra data from the value
Read the datablock that is after the value and then the final END marker.
Returns nothing
17 18 19 20 21 22 23 24 |
# File 'lib/kjess/response/value.rb', line 17 def read_more( connection ) read_size = bytes + CRLF.bytesize total_data = connection.read( read_size ) @data = total_data[0...bytes] line = connection.readline KJess::Response.parse( line ) # throw away the 'END' line end |