Class: Tair::GetRequest

Inherits:
Request show all
Defined in:
lib/tair/operation/get.rb

Direct Known Subclasses

DelRequest

Defined Under Namespace

Classes: Body

Constant Summary collapse

PACKET_CODE =
2

Constants inherited from Request

Request::MAX_INT32, Request::TAIR_PACKET_FLAG

Instance Attribute Summary

Attributes inherited from Request

#namespace

Instance Method Summary collapse

Methods inherited from Request

#encode, #header, #inspect, #packet_code, #req_id

Constructor Details

#initialize(key) ⇒ GetRequest

Returns a new instance of GetRequest.



26
27
28
# File 'lib/tair/operation/get.rb', line 26

def initialize(key)
  @key  = key
end

Instance Method Details

#bodyObject



31
32
33
34
35
36
# File 'lib/tair/operation/get.rb', line 31

def body
  Body.new.tap do |body|
    body.namespace = namespace || 0
    body.key = @key
  end
end