Class: Cql::Protocol::StartupRequest

Inherits:
Request
  • Object
show all
Defined in:
lib/cql/protocol/requests/startup_request.rb

Instance Attribute Summary

Attributes inherited from Request

#opcode

Instance Method Summary collapse

Methods inherited from Request

change_stream_id, #encode_frame

Methods included from Encoding

#write_bytes, #write_consistency, #write_decimal, #write_double, #write_float, #write_int, #write_long, #write_long_string, #write_short, #write_short_bytes, #write_string, #write_string_list, #write_string_map, #write_uuid, #write_varint

Constructor Details

#initialize(cql_version = '3.0.0', compression = nil) ⇒ StartupRequest

Returns a new instance of StartupRequest.



6
7
8
9
10
# File 'lib/cql/protocol/requests/startup_request.rb', line 6

def initialize(cql_version='3.0.0', compression=nil)
  super(1)
  @arguments = {CQL_VERSION => cql_version}
  @arguments[COMPRESSION] = compression if compression
end

Instance Method Details

#to_sObject



16
17
18
# File 'lib/cql/protocol/requests/startup_request.rb', line 16

def to_s
  %(STARTUP #@arguments)
end

#write(io) ⇒ Object



12
13
14
# File 'lib/cql/protocol/requests/startup_request.rb', line 12

def write(io)
  write_string_map(io, @arguments)
end