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.



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

#keyObject

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

Returns:

  • (Boolean)


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

def requires_lock?
  @name == :set
end