Class: Gearman::Worker::Ability
- Inherits:
-
Object
- Object
- Gearman::Worker::Ability
- Defined in:
- lib/gearman/worker.rb
Overview
Ability
Description
Information about an ability that we possess.
Instance Attribute Summary collapse
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
Instance Method Summary collapse
-
#initialize(block, timeout = nil) ⇒ Ability
constructor
Create a new ability.
-
#run(data, job) ⇒ Object
Run the block of code.
Constructor Details
#initialize(block, timeout = nil) ⇒ Ability
Create a new ability.
43 44 45 46 |
# File 'lib/gearman/worker.rb', line 43 def initialize(block, timeout=nil) @block = block @timeout = timeout end |
Instance Attribute Details
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
47 48 49 |
# File 'lib/gearman/worker.rb', line 47 def timeout @timeout end |
Instance Method Details
#run(data, job) ⇒ Object
Run the block of code.
54 55 56 |
# File 'lib/gearman/worker.rb', line 54 def run(data, job) @block.call(data, job) end |