Class: SomTimer::Service
- Inherits:
-
Object
- Object
- SomTimer::Service
- Defined in:
- lib/som_timer/service.rb
Instance Method Summary collapse
- #create_rest(mood_rating_1, mood_rating_2, content_selected, focus_interval, rest_interval) ⇒ Object
- #exercises ⇒ Object
-
#initialize(path) ⇒ Service
constructor
A new instance of Service.
- #rand_exercise(duration, category) ⇒ Object
- #rests ⇒ Object
- #timer ⇒ Object
- #update_timer(work_interval, rest_interval, sound) ⇒ Object
Constructor Details
#initialize(path) ⇒ Service
Returns a new instance of Service.
2 3 4 |
# File 'lib/som_timer/service.rb', line 2 def initialize(path) @path = path end |
Instance Method Details
#create_rest(mood_rating_1, mood_rating_2, content_selected, focus_interval, rest_interval) ⇒ Object
26 27 28 |
# File 'lib/som_timer/service.rb', line 26 def create_rest(, , content_selected, focus_interval, rest_interval) to_json_post(, , content_selected, focus_interval, rest_interval) end |
#exercises ⇒ Object
10 11 12 |
# File 'lib/som_timer/service.rb', line 10 def exercises to_json("#{@path}") end |
#rand_exercise(duration, category) ⇒ Object
14 15 16 |
# File 'lib/som_timer/service.rb', line 14 def rand_exercise(duration, category) to_json("#{@path}?duration=#{duration}&category=#{category}") end |
#rests ⇒ Object
22 23 24 |
# File 'lib/som_timer/service.rb', line 22 def rests to_json("#{@path}") end |
#timer ⇒ Object
6 7 8 |
# File 'lib/som_timer/service.rb', line 6 def timer to_json("#{@path}") end |
#update_timer(work_interval, rest_interval, sound) ⇒ Object
18 19 20 |
# File 'lib/som_timer/service.rb', line 18 def update_timer(work_interval, rest_interval, sound) to_json_put(work_interval, rest_interval, sound) end |