lib/restruct/nested_hash.rb in restruct-0.0.3 vs lib/restruct/nested_hash.rb in restruct-0.1.0
- old
+ new
@@ -7,11 +7,11 @@
include Enumerable
const_set :TYPE, type
def [](key)
- self.class::TYPE.new id: id[key], redis: redis, parent: self
+ self.class::TYPE.new id: id[key], connection: connection, parent: self
end
def fetch(key)
raise KeyError, "key not found: #{key}" unless key? key
self[key]
@@ -37,10 +37,10 @@
self
end
def keys
sections = id.sections.count + 1
- redis.call('KEYS', id['*']).map do |k|
+ connection.call('KEYS', id['*']).map do |k|
Id.new(k).sections.take(sections).last
end.uniq.sort
end
def values
\ No newline at end of file