Class: KJess::Response::Value

Inherits:
KJess::Response show all
Defined in:
lib/kjess/response/value.rb

Constant Summary

Constants inherited from KJess::Response

Registry

Constants inherited from Protocol

Protocol::CRLF

Instance Attribute Summary collapse

Attributes inherited from Protocol

#args, #raw_args

Instance Method Summary collapse

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

#dataObject

Returns the value of attribute data.



6
7
8
# File 'lib/kjess/response/value.rb', line 6

def data
  @data
end

Instance Method Details

#bytesObject



10
# File 'lib/kjess/response/value.rb', line 10

def bytes; args[2].to_i; end

#flagsObject



9
# File 'lib/kjess/response/value.rb', line 9

def flags; args[1].to_i; end

#queueObject



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