lib/riak/crdt/set.rb in riak-client-2.1.0 vs lib/riak/crdt/set.rb in riak-client-2.2.0.pre1
- old
+ new
@@ -5,20 +5,23 @@
#
# Uses the Ruby standard library `::Set` frequently, so the full class names will
# be used frequently.
class Set < Base
- # Create a set instance. If not provided, the default bucket type from
- # {Riak::Crdt} will be used.
+ # Create a set instance. The bucket type is determined by the first of
+ # these sources:
#
+ # 1. The `bucket_type` String argument
+ # 2. A {BucketTyped::Bucket} as the `bucket` argument
+ # 3. The `Crdt::Base::DEFAULT_BUCKET_TYPES[:set]` entry
+ #
# @param bucket [Bucket] the {Riak::Bucket} for this set
# @param [String, nil] key The name of the set. A nil key makes
# Riak assign a key.
# @param [String] bucket_type The optional bucket type for this set.
- # The default is in `Crdt::Base::DEFAULT_BUCKET_TYPES[:set]`.
# @param options [Hash]
def initialize(bucket, key, bucket_type=nil, options={})
- super(bucket, key, bucket_type || DEFAULT_BUCKET_TYPES[:set], options)
+ super(bucket, key, bucket_type || :set, options)
end
# Yields a `BatchSet` to proxy multiple set operations into a single
# Riak update. The `BatchSet` has the same methods as this
# {Riak::Crdt::Set}.