lib/redis_object/storage/adapter.rb in redis_object-1.0 vs lib/redis_object/storage/adapter.rb in redis_object-1.1
- old
+ new
@@ -21,18 +21,21 @@
a
end
end
def reset
- @connections.each_index do |i|
- @connections[i] = nil
+ connections.each_index do |i|
+ connections[i] = nil
end
end
alias_method :reconnect!, :reset
def connection(num=0)
+ connections[num] ||= new_connection
+ end
+
+ def connections
@connections ||= []
- @connections[num] ||= new_connection
end
def new_connection
true
end
\ No newline at end of file