Class: SomTimer::TimerFacade

Inherits:
Object
  • Object
show all
Defined in:
lib/som_timer/facades/timer_facade.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pathObject (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_timerObject



17
18
19
# File 'lib/som_timer/facades/timer_facade.rb', line 17

def one_timer
  SomTimer::Timer.new(response_timer)
end

#response_timerObject



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