Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Bakken committed Jun 9, 2016
1 parent b1f9c7b commit be746b1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/riak/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ def get_many(pairs)
# Get an object. See Bucket#get
def get_object(bucket, key, options = {})
fail ArgumentError, t('zero_length_key') if key == ''
fail ArgumentError, t('string_type', :string => key) unless key.nil? or String === key
fail ArgumentError, t('string_type', :string => key) unless String === key
backend do |b|
b.fetch_object(bucket, key, options)
end
Expand Down
4 changes: 2 additions & 2 deletions lib/riak/counter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ class Counter
# @param [Bucket] bucket the {Riak::Bucket} for this counter
# @param [String] key the name of the counter
def initialize(bucket, key)
fail ArgumentError, t('bucket_type', bucket: bucket.inspect) unless bucket.is_a? Bucket
fail ArgumentError, t('string_type', string: key.inspect) unless key.is_a? String
fail ArgumentError, t('bucket_type', bucket: bucket.inspect) unless Bucket === bucket
fail ArgumentError, t('string_type', string: key.inspect) unless String === key
@bucket, @key = bucket, key
@client = bucket.client

Expand Down
1 change: 1 addition & 0 deletions lib/riak/robject.rb
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def store(options = {})
fail Conflict, self if conflict?
fail ArgumentError, t('content_type_undefined') unless content_type.present?
fail ArgumentError, t('zero_length_key') if key == ''
# NB: key can be nil to indicate that Riak should generate one
fail ArgumentError, t('string_type', :string => key) unless key.nil? or String === key
@bucket.client.store_object(self, default(options))
self
Expand Down

0 comments on commit be746b1

Please sign in to comment.