lib/redis/list.rb in redis-objects-0.2.3 vs lib/redis/list.rb in redis-objects-0.2.4
- old
+ new
@@ -10,13 +10,13 @@
include Redis::Helpers::CoreCommands
require 'redis/helpers/serialize'
include Redis::Helpers::Serialize
attr_reader :key, :options, :redis
- def initialize(key, redis=$redis, options={})
+ def initialize(key, *args)
@key = key
- @redis = redis
- @options = options
+ @options = args.last.is_a?(Hash) ? args.pop : {}
+ @redis = args.first || $redis
end
# Works like push. Can chain together: list << 'a' << 'b'
def <<(value)
push(value)
\ No newline at end of file