I'm writing a build script in Rake that uses a couple of 3rd party gems. One of these gem defines a class called Hash
.
class Hash
alias hkeys keys
def keys
hkeys.sort {|a,b| a.to_s <=> b.to_s }
end
def each
keys.each { |k| yield k, self[k] }
end
end
This is breaking enumeration, resulting in no block given (yield) (LocalJumpError)
. I read that I can use ::Hash
to reference the core ruby type, but how would this fit with code like
bucket.objects.each do |obj|
puts "#{obj.key} => #{obj.etag}"
end