Class: SomTimer::TimerFacade
- Inherits:
-
Object
- Object
- SomTimer::TimerFacade
- Defined in:
- lib/som_timer/facades/timer_facade.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path) ⇒ TimerFacade
constructor
A new instance of TimerFacade.
- #one_timer ⇒ Object
- #response_timer ⇒ Object
- #response_update_timer(work_interval, rest_interval, sound) ⇒ Object
- #update_timer(work_interval, rest_interval, sound) ⇒ Object
Constructor Details
#initialize(path) ⇒ TimerFacade
Returns a new instance of TimerFacade.
4 5 6 7 |
# File 'lib/som_timer/facades/timer_facade.rb', line 4 def initialize(path) @path = path @service = SomTimer::Service.new(@path) end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
2 3 4 |
# File 'lib/som_timer/facades/timer_facade.rb', line 2 def path @path end |
Instance Method Details
#one_timer ⇒ Object
17 18 19 |
# File 'lib/som_timer/facades/timer_facade.rb', line 17 def one_timer SomTimer::Timer.new(response_timer) end |
#response_timer ⇒ Object
9 10 11 |
# File 'lib/som_timer/facades/timer_facade.rb', line 9 def response_timer @service.timer end |
#response_update_timer(work_interval, rest_interval, sound) ⇒ Object
13 14 15 |
# File 'lib/som_timer/facades/timer_facade.rb', line 13 def response_update_timer(work_interval, rest_interval, sound) @service.update_timer(work_interval, rest_interval, sound) end |
#update_timer(work_interval, rest_interval, sound) ⇒ Object
21 22 23 |
# File 'lib/som_timer/facades/timer_facade.rb', line 21 def update_timer(work_interval, rest_interval, sound) SomTimer::Timer.new(response_update_timer(work_interval, rest_interval, sound)) end |