Class: Riak::Client::BeefcakeProtobuffsBackend::BucketPropertiesOperator
- Defined in:
- lib/riak/client/beefcake/bucket_properties_operator.rb
Constant Summary collapse
- QUORUMS =
Riak::Client::ProtobuffsBackend::QUORUMS
Instance Attribute Summary collapse
-
#backend ⇒ Object
readonly
Returns the value of attribute backend.
Instance Method Summary collapse
- #get(bucket, options = {}) ⇒ Object
-
#initialize(backend) ⇒ BucketPropertiesOperator
constructor
A new instance of BucketPropertiesOperator.
- #put(bucket, props = {}, options = {}) ⇒ Object
Constructor Details
#initialize(backend) ⇒ BucketPropertiesOperator
Returns a new instance of BucketPropertiesOperator.
26 27 28 |
# File 'lib/riak/client/beefcake/bucket_properties_operator.rb', line 26 def initialize(backend) @backend = backend end |
Instance Attribute Details
#backend ⇒ Object (readonly)
Returns the value of attribute backend.
22 23 24 |
# File 'lib/riak/client/beefcake/bucket_properties_operator.rb', line 22 def backend @backend end |
Instance Method Details
#get(bucket, options = {}) ⇒ Object
30 31 32 33 34 35 36 37 38 39 |
# File 'lib/riak/client/beefcake/bucket_properties_operator.rb', line 30 def get(bucket, = {}) response = backend.protocol do |p| p.write :GetBucketReq, get_request(bucket, ) p.expect :GetBucketResp, RpbGetBucketResp end properties = response.props.to_hash.stringify_keys return rubyfy(properties) end |
#put(bucket, props = {}, options = {}) ⇒ Object
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/riak/client/beefcake/bucket_properties_operator.rb', line 41 def put(bucket, props = {}, = {}) properties = riakify props request = put_request bucket, properties, backend.protocol do |p| p.write :SetBucketReq, request p.expect :SetBucketResp end end |