Class: HireFire::Worker
- Inherits:
-
Object
- Object
- HireFire::Worker
- Defined in:
- lib/hirefire/worker.rb
Defined Under Namespace
Classes: InvalidDynoNameError, MissingDynoBlockError
Constant Summary collapse
- PROCESS_NAME_PATTERN =
/\A[a-zA-Z][a-zA-Z0-9_-]{0,62}\z/
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, &block) ⇒ Worker
constructor
A new instance of Worker.
- #value ⇒ Object
Constructor Details
#initialize(name, &block) ⇒ Worker
Returns a new instance of Worker.
13 14 15 16 17 |
# File 'lib/hirefire/worker.rb', line 13 def initialize(name, &block) validate(name, &block) @name = name @block = block end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
11 12 13 |
# File 'lib/hirefire/worker.rb', line 11 def name @name end |
Instance Method Details
#value ⇒ Object
19 20 21 |
# File 'lib/hirefire/worker.rb', line 19 def value @block.call end |