Class: Tarantool::Requests::Select
- Inherits:
-
Tarantool::Request
- Object
- Tarantool::Request
- Tarantool::Requests::Select
- Defined in:
- lib/tarantool/requests/select.rb
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#index_no ⇒ Object
readonly
Returns the value of attribute index_no.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#offset ⇒ Object
readonly
Returns the value of attribute offset.
-
#tuples ⇒ Object
readonly
Returns the value of attribute tuples.
Attributes inherited from Tarantool::Request
#args, #params, #space, #space_no
Instance Method Summary collapse
Methods inherited from Tarantool::Request
#connection, #initialize, #make_packet, #make_response, pack_field, pack_tuple, #perform, #request_id, request_type, #response_params
Constructor Details
This class inherits a constructor from Tarantool::Request
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
6 7 8 |
# File 'lib/tarantool/requests/select.rb', line 6 def count @count end |
#index_no ⇒ Object (readonly)
Returns the value of attribute index_no.
6 7 8 |
# File 'lib/tarantool/requests/select.rb', line 6 def index_no @index_no end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
6 7 8 |
# File 'lib/tarantool/requests/select.rb', line 6 def limit @limit end |
#offset ⇒ Object (readonly)
Returns the value of attribute offset.
6 7 8 |
# File 'lib/tarantool/requests/select.rb', line 6 def offset @offset end |
#tuples ⇒ Object (readonly)
Returns the value of attribute tuples.
6 7 8 |
# File 'lib/tarantool/requests/select.rb', line 6 def tuples @tuples end |
Instance Method Details
#make_body ⇒ Object
16 17 18 19 |
# File 'lib/tarantool/requests/select.rb', line 16 def make_body [space_no, index_no, offset, limit, tuples.size].pack('LLLLL') + tuples.map { |tuple| self.class.pack_tuple(*tuple) }.join end |
#parse_args ⇒ Object
7 8 9 10 11 12 13 14 |
# File 'lib/tarantool/requests/select.rb', line 7 def parse_args @index_no = params[:index_no] || 0 @offset = params[:offset] || 0 @limit = params[:limit] || -1 @tuples = params[:values] || args raise(ArgumentError.new('values are required')) if tuples.empty? params[:return_tuple] = true end |