lib/restruct/connection.rb in restruct-0.1.0 vs lib/restruct/connection.rb in restruct-0.2.0
- old
+ new
@@ -1,9 +1,10 @@
module Restruct
class Connection
def initialize(*args)
+ @args = args
@redis = Redic.new *args
@scripts = {}
@nesting = ::Hash.new { |h,k| h[k] = 0 }
end
@@ -40,9 +41,17 @@
end
commit unless nested?
rescue => ex
redis.clear unless nested?
raise ex
+ end
+
+ def read
+ redis.client.read
+ end
+
+ def clone
+ Connection.new *@args
end
private
attr_reader :redis, :scripts
\ No newline at end of file