Class: Punchline::MinQueue::Script
- Inherits:
-
Object
- Object
- Punchline::MinQueue::Script
- Defined in:
- lib/punchline/min_queue.rb
Constant Summary collapse
- SCRIPT_BASE_PATH =
File.('../lua', __FILE__)
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#redis ⇒ Object
Returns the value of attribute redis.
-
#script_name ⇒ Object
Returns the value of attribute script_name.
-
#sha ⇒ Object
Returns the value of attribute sha.
Instance Method Summary collapse
- #call(keys = [], argv = []) ⇒ Object
-
#initialize(redis, script_name) ⇒ Script
constructor
A new instance of Script.
Constructor Details
#initialize(redis, script_name) ⇒ Script
Returns a new instance of Script.
61 62 63 64 |
# File 'lib/punchline/min_queue.rb', line 61 def initialize(redis, script_name) @redis = redis @script_name = script_name end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
59 60 61 |
# File 'lib/punchline/min_queue.rb', line 59 def body @body end |
#redis ⇒ Object
Returns the value of attribute redis.
59 60 61 |
# File 'lib/punchline/min_queue.rb', line 59 def redis @redis end |
#script_name ⇒ Object
Returns the value of attribute script_name.
59 60 61 |
# File 'lib/punchline/min_queue.rb', line 59 def script_name @script_name end |
#sha ⇒ Object
Returns the value of attribute sha.
59 60 61 |
# File 'lib/punchline/min_queue.rb', line 59 def sha @sha end |
Instance Method Details
#call(keys = [], argv = []) ⇒ Object
66 67 68 69 |
# File 'lib/punchline/min_queue.rb', line 66 def call(keys = [], argv = []) load! unless @body @redis.evalsha sha, keys, argv end |