Class: Cql::Protocol::SchemaChangeEventResponse
- Inherits:
-
EventResponse
- Object
- Response
- ResultResponse
- EventResponse
- Cql::Protocol::SchemaChangeEventResponse
- Defined in:
- lib/cql/protocol/responses/schema_change_event_result_response.rb
Constant Summary collapse
- TYPE =
'SCHEMA_CHANGE'.freeze
Instance Attribute Summary collapse
-
#change ⇒ Object
readonly
Returns the value of attribute change.
-
#keyspace ⇒ Object
readonly
Returns the value of attribute keyspace.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #eql?(rs) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(*args) ⇒ SchemaChangeEventResponse
constructor
A new instance of SchemaChangeEventResponse.
- #to_s ⇒ Object
Methods inherited from ResultResponse
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) ⇒ SchemaChangeEventResponse
Returns a new instance of SchemaChangeEventResponse.
10 11 12 13 |
# File 'lib/cql/protocol/responses/schema_change_event_result_response.rb', line 10 def initialize(*args) @change, @keyspace, @table = args @type = TYPE end |
Instance Attribute Details
#change ⇒ Object (readonly)
Returns the value of attribute change.
8 9 10 |
# File 'lib/cql/protocol/responses/schema_change_event_result_response.rb', line 8 def change @change end |
#keyspace ⇒ Object (readonly)
Returns the value of attribute keyspace.
8 9 10 |
# File 'lib/cql/protocol/responses/schema_change_event_result_response.rb', line 8 def keyspace @keyspace end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
8 9 10 |
# File 'lib/cql/protocol/responses/schema_change_event_result_response.rb', line 8 def table @table end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/cql/protocol/responses/schema_change_event_result_response.rb', line 8 def type @type end |
Class Method Details
.decode!(buffer) ⇒ Object
15 16 17 |
# File 'lib/cql/protocol/responses/schema_change_event_result_response.rb', line 15 def self.decode!(buffer) new(read_string!(buffer), read_string!(buffer), read_string!(buffer)) end |
Instance Method Details
#eql?(rs) ⇒ Boolean Also known as: ==
19 20 21 |
# File 'lib/cql/protocol/responses/schema_change_event_result_response.rb', line 19 def eql?(rs) rs.type == self.type && rs.change == self.change && rs.keyspace == self.keyspace && rs.table == self.table end |
#hash ⇒ Object
24 25 26 27 28 29 30 31 32 33 |
# File 'lib/cql/protocol/responses/schema_change_event_result_response.rb', line 24 def hash @h ||= begin h = 0 h = ((h & 33554431) * 31) ^ @type.hash h = ((h & 33554431) * 31) ^ @change.hash h = ((h & 33554431) * 31) ^ @keyspace.hash h = ((h & 33554431) * 31) ^ @table.hash h end end |
#to_s ⇒ Object
35 36 37 |
# File 'lib/cql/protocol/responses/schema_change_event_result_response.rb', line 35 def to_s %(EVENT #@type #@change "#@keyspace" "#@table") end |