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.
115 116 117 118 119 |
# File 'lib/cash/buffered.rb', line 115 def initialize(name, key, *args) @name = name @key = key @args = args end |
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
113 114 115 |
# File 'lib/cash/buffered.rb', line 113 def key @key end |
Instance Method Details
#call(cache) ⇒ Object
125 126 127 |
# File 'lib/cash/buffered.rb', line 125 def call(cache) cache.send @name, @key, *@args end |
#requires_lock? ⇒ Boolean
121 122 123 |
# File 'lib/cash/buffered.rb', line 121 def requires_lock? @name == :set end |