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.
12 13 14 |
# File 'lib/riak/client/beefcake/bucket_properties_operator.rb', line 12 def initialize(backend) @backend = backend end |
Instance Attribute Details
#backend ⇒ Object (readonly)
Returns the value of attribute backend.
8 9 10 |
# File 'lib/riak/client/beefcake/bucket_properties_operator.rb', line 8 def backend @backend end |
Instance Method Details
#get(bucket, options = {}) ⇒ Object
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/riak/client/beefcake/bucket_properties_operator.rb', line 16 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
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/riak/client/beefcake/bucket_properties_operator.rb', line 27 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 |