Class: Healthety::Worker
- Inherits:
-
Object
- Object
- Healthety::Worker
- Defined in:
- lib/healthety/worker.rb
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.
- #interval(interval = nil) ⇒ Object
- #perform ⇒ Object
- #value(value = nil) ⇒ Object
Constructor Details
#initialize(name, &block) ⇒ Worker
Returns a new instance of Worker.
5 6 7 8 |
# File 'lib/healthety/worker.rb', line 5 def initialize(name, &block) @name = name.to_s @block = block end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/healthety/worker.rb', line 3 def name @name end |
Instance Method Details
#interval(interval = nil) ⇒ Object
10 11 12 |
# File 'lib/healthety/worker.rb', line 10 def interval(interval = nil) @interval = interval || @interval end |
#perform ⇒ Object
18 19 20 |
# File 'lib/healthety/worker.rb', line 18 def perform instance_eval(&@block) end |
#value(value = nil) ⇒ Object
14 15 16 |
# File 'lib/healthety/worker.rb', line 14 def value(value = nil) @value = value || @value end |