Class: Cql::Protocol::StatusChangeEventResponse

Inherits:
EventResponse show all
Defined in:
lib/cql/protocol/responses/status_change_event_result_response.rb

Direct Known Subclasses

TopologyChangeEventResponse

Constant Summary collapse

TYPE =
'STATUS_CHANGE'.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ResultResponse

#void?

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) ⇒ StatusChangeEventResponse

Returns a new instance of StatusChangeEventResponse.



10
11
12
13
# File 'lib/cql/protocol/responses/status_change_event_result_response.rb', line 10

def initialize(*args)
  @change, @address, @port = args
  @type = TYPE
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



8
9
10
# File 'lib/cql/protocol/responses/status_change_event_result_response.rb', line 8

def address
  @address
end

#changeObject (readonly)

Returns the value of attribute change.



8
9
10
# File 'lib/cql/protocol/responses/status_change_event_result_response.rb', line 8

def change
  @change
end

#portObject (readonly)

Returns the value of attribute port.



8
9
10
# File 'lib/cql/protocol/responses/status_change_event_result_response.rb', line 8

def port
  @port
end

#typeObject (readonly)

Returns the value of attribute type.



8
9
10
# File 'lib/cql/protocol/responses/status_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/status_change_event_result_response.rb', line 15

def self.decode!(buffer)
  new(read_string!(buffer), *read_inet!(buffer))
end

Instance Method Details

#to_sObject



19
20
21
# File 'lib/cql/protocol/responses/status_change_event_result_response.rb', line 19

def to_s
  %(EVENT #@type #@change #@address:#@port)
end