Class: Cql::Protocol::ErrorResponse
- Defined in:
- lib/cql/protocol/responses/error_response.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ ErrorResponse
constructor
A new instance of ErrorResponse.
- #to_s ⇒ Object
Methods included from Decoding
#read_byte!, #read_bytes!, #read_consistency!, #read_decimal!, #read_double!, #read_float!, #read_inet!, #read_int!, #read_long!, #read_long_string!, #read_option!, #read_short!, #read_short_bytes!, #read_string!, #read_string_list!, #read_string_map!, #read_string_multimap!, #read_uuid!, #read_varint!
Constructor Details
#initialize(*args) ⇒ ErrorResponse
Returns a new instance of ErrorResponse.
8 9 10 |
# File 'lib/cql/protocol/responses/error_response.rb', line 8 def initialize(*args) @code, @message = args end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
6 7 8 |
# File 'lib/cql/protocol/responses/error_response.rb', line 6 def code @code end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
6 7 8 |
# File 'lib/cql/protocol/responses/error_response.rb', line 6 def @message end |
Class Method Details
.decode!(buffer) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/cql/protocol/responses/error_response.rb', line 12 def self.decode!(buffer) code = read_int!(buffer) = read_string!(buffer) case code when 0x1000, 0x1100, 0x1200, 0x2400, 0x2500 DetailedErrorResponse.decode!(code, , buffer) else new(code, ) end end |
Instance Method Details
#to_s ⇒ Object
23 24 25 |
# File 'lib/cql/protocol/responses/error_response.rb', line 23 def to_s %(ERROR #@code "#@message") end |