Class: Tmtms::Timer::Job
- Inherits:
-
Object
- Object
- Tmtms::Timer::Job
- Defined in:
- lib/tmtms/timer.rb
Overview
Timer job
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#repeat ⇒ Object
readonly
Returns the value of attribute repeat.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
-
#cancel ⇒ self
cancel this job.
-
#initialize(timer:, time:, repeat: nil, block:) ⇒ Job
constructor
A new instance of Job.
Constructor Details
#initialize(timer:, time:, repeat: nil, block:) ⇒ Job
Returns a new instance of Job.
18 19 20 |
# File 'lib/tmtms/timer.rb', line 18 def initialize(timer:, time:, repeat: nil, block:) @timer, @time, @repeat, @block = timer, time, repeat, block end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
13 14 15 |
# File 'lib/tmtms/timer.rb', line 13 def block @block end |
#repeat ⇒ Object (readonly)
Returns the value of attribute repeat.
13 14 15 |
# File 'lib/tmtms/timer.rb', line 13 def repeat @repeat end |
#time ⇒ Object
Returns the value of attribute time.
12 13 14 |
# File 'lib/tmtms/timer.rb', line 12 def time @time end |
Instance Method Details
#cancel ⇒ self
cancel this job.
24 25 26 |
# File 'lib/tmtms/timer.rb', line 24 def cancel @timer.cancel(self) end |