Class: SomTimer::Service

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

Instance Method Summary collapse

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(mood_rating_1, mood_rating_2, content_selected, focus_interval, rest_interval)
  to_json_post(mood_rating_1, mood_rating_2, content_selected, focus_interval, rest_interval)
end

#exercisesObject



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

#restsObject



22
23
24
# File 'lib/som_timer/service.rb', line 22

def rests
  to_json("#{@path}")
end

#timerObject



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