Class: Cash::Command
- Inherits:
-
Object
- Object
- Cash::Command
- Defined in:
- lib/cash/buffered.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
Returns the value of attribute key.
Instance Method Summary collapse
- #call(cache) ⇒ Object
-
#initialize(name, key, *args) ⇒ Command
constructor
A new instance of Command.
- #requires_lock? ⇒ Boolean
Constructor Details
#initialize(name, key, *args) ⇒ Command
Returns a new instance of Command.
112 113 114 115 116 |
# File 'lib/cash/buffered.rb', line 112 def initialize(name, key, *args) @name = name @key = key @args = args end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
110 111 112 |
# File 'lib/cash/buffered.rb', line 110 def key @key end |
Instance Method Details
#call(cache) ⇒ Object
122 123 124 |
# File 'lib/cash/buffered.rb', line 122 def call(cache) cache.send @name, @key, *@args end |
#requires_lock? ⇒ Boolean
118 119 120 |
# File 'lib/cash/buffered.rb', line 118 def requires_lock? @name == :set end |