lib/riak/bucket.rb in riak-client-2.4.0 vs lib/riak/bucket.rb in riak-client-2.4.1

- old
+ new

@@ -1,15 +1,17 @@ +require 'riak/util/string' require 'riak/util/translation' require 'riak/client' require 'riak/robject' require 'riak/counter' require 'riak/errors/failed_request' module Riak # Represents and encapsulates operations on a Riak bucket. You may retrieve a bucket # using {Client#bucket}, or create it manually and retrieve its meta-information later. class Bucket + include Util::String include Util::Translation # (Riak Search) The precommit specification for kv/search integration SEARCH_PRECOMMIT_HOOK = {"mod" => "riak_search_kv_hook", "fun" => "precommit"} @@ -292,14 +294,9 @@ # @return [true,false] whether the other is equivalent def ==(other) return false unless self.class == other.class return false unless self.client == other.client - return true if self.name.nil? && other.name.nil? - unless self.name.respond_to?(:bytes) && other.name.respond_to?(:bytes) - return false - end - return false unless self.name.bytes == other.name.bytes - true + return equal_bytes?(self.name, other.name) end end end