Class: Cql::Protocol::PrepareRequest
- Defined in:
- lib/cql/protocol/requests/prepare_request.rb
Instance Attribute Summary collapse
-
#cql ⇒ Object
readonly
Returns the value of attribute cql.
Attributes inherited from Request
Instance Method Summary collapse
- #eql?(rq) ⇒ Boolean (also: #==)
- #hash ⇒ Object
-
#initialize(cql) ⇒ PrepareRequest
constructor
A new instance of PrepareRequest.
- #to_s ⇒ Object
- #write(io) ⇒ Object
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) ⇒ PrepareRequest
Returns a new instance of PrepareRequest.
8 9 10 11 12 |
# File 'lib/cql/protocol/requests/prepare_request.rb', line 8 def initialize(cql) raise ArgumentError, 'No CQL given!' unless cql super(9) @cql = cql end |
Instance Attribute Details
#cql ⇒ Object (readonly)
Returns the value of attribute cql.
6 7 8 |
# File 'lib/cql/protocol/requests/prepare_request.rb', line 6 def cql @cql end |
Instance Method Details
#eql?(rq) ⇒ Boolean Also known as: ==
22 23 24 |
# File 'lib/cql/protocol/requests/prepare_request.rb', line 22 def eql?(rq) self.class === rq && rq.cql == self.cql end |
#hash ⇒ Object
27 28 29 |
# File 'lib/cql/protocol/requests/prepare_request.rb', line 27 def hash @h ||= @cql.hash end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/cql/protocol/requests/prepare_request.rb', line 18 def to_s %(PREPARE "#@cql") end |
#write(io) ⇒ Object
14 15 16 |
# File 'lib/cql/protocol/requests/prepare_request.rb', line 14 def write(io) write_long_string(io, @cql) end |