Class: Appshot::Redis
- Inherits:
-
Object
- Object
- Appshot::Redis
- Defined in:
- lib/appshot/app/redis.rb
Instance Method Summary collapse
- #call(call_chain) ⇒ Object
-
#initialize(opts = {}) ⇒ Redis
constructor
A new instance of Redis.
- #invoke_save ⇒ Object
Constructor Details
#initialize(opts = {}) ⇒ Redis
Returns a new instance of Redis.
4 5 6 7 |
# File 'lib/appshot/app/redis.rb', line 4 def initialize(opts={}) @save_before_snapshot = opts[:save_before_snapshot] || false @redis_binary = opts[:database_command] || "redis-cli" end |
Instance Method Details
#call(call_chain) ⇒ Object
9 10 11 12 13 |
# File 'lib/appshot/app/redis.rb', line 9 def call(call_chain) next_action = call_chain.shift invoke_save if @save_before_snapshot next_action.call(call_chain) unless next_action.nil? end |
#invoke_save ⇒ Object
15 16 17 |
# File 'lib/appshot/app/redis.rb', line 15 def invoke_save %x[ #{@redis_binary} bgsave ] end |