Class: HireFire::Worker

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



11
12
13
# File 'lib/hirefire/worker.rb', line 11

def name
  @name
end

Instance Method Details

#valueObject



19
20
21
# File 'lib/hirefire/worker.rb', line 19

def value
  @block.call
end