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.



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

#keyObject

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

Returns:

  • (Boolean)


118
119
120
# File 'lib/cash/buffered.rb', line 118

def requires_lock?
  @name == :set
end