lib/riak/bucket.rb in riak-client-1.1.1 vs lib/riak/bucket.rb in riak-client-1.2.0
- old
+ new
@@ -76,10 +76,19 @@
def props
@props ||= @client.get_bucket_props(self)
end
alias :properties :props
+ # Clears bucket properties, reverting them to the defaults.
+ # @return [true, false] whether the properties were cleared
+ # @since Riak 1.3
+ def clear_props
+ @props = nil
+ @client.clear_bucket_props(self)
+ end
+ alias :clear_properties :clear_props
+
# Retrieve an object from within the bucket.
# @param [String] key the key of the object to retrieve
# @param [Hash] options query parameters for the request
# @option options [Fixnum] :r - the read quorum for the request - how many nodes should concur on the read
# @return [Riak::RObject] the object
@@ -203,10 +212,10 @@
# (Riak Search) Detects whether the bucket is automatically indexed into
# riak_search.
# @return [true,false] whether the bucket includes the search indexing hook
def is_indexed?
- props['search'] == true || props['precommit'].include?(SEARCH_PRECOMMIT_HOOK)
+ props['search'] == true || (props.has_key?('precommit') && props['precommit'].include?(SEARCH_PRECOMMIT_HOOK))
end
# @return [String] a representation suitable for IRB and debugging output
def inspect
"#<Riak::Bucket {#{name}}#{" keys=[#{keys.join(',')}]" if defined?(@keys)}>"