Class: Cash::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/cash/buffered.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, key, *args) ⇒ Command

Returns a new instance of Command.



123
124
125
126
127
# File 'lib/cash/buffered.rb', line 123

def initialize(name, key, *args)
  @name = name
  @key = key
  @args = args
end

Instance Attribute Details

#keyObject

Returns the value of attribute key.



121
122
123
# File 'lib/cash/buffered.rb', line 121

def key
  @key
end

Instance Method Details

#call(cache) ⇒ Object



133
134
135
# File 'lib/cash/buffered.rb', line 133

def call(cache)
  cache.send @name, @key, *@args
end

#requires_lock?Boolean

Returns:

  • (Boolean)


129
130
131
# File 'lib/cash/buffered.rb', line 129

def requires_lock?
  @name == :set
end