class SomTimer::ExerciseFacade
Attributes
path[R]
Public Class Methods
new(path)
click to toggle source
# File lib/som_timer/facades/exercise_facade.rb, line 4 def initialize(path) @path = path @service = SomTimer::Service.new(@path) end
Public Instance Methods
exercises()
click to toggle source
# File lib/som_timer/facades/exercise_facade.rb, line 17 def exercises exercises_info = response_exercises[:exercises] exercises_info.map do |exercise| SomTimer::Exercise.new(exercise) end end
rand_exercise(duration, category)
click to toggle source
# File lib/som_timer/facades/exercise_facade.rb, line 25 def rand_exercise(duration, category) SomTimer::Exercise.new(response_rand_exercise(duration, category)) end
response_exercises()
click to toggle source
# File lib/som_timer/facades/exercise_facade.rb, line 9 def response_exercises @service.exercises end
response_rand_exercise(duration, category)
click to toggle source
# File lib/som_timer/facades/exercise_facade.rb, line 13 def response_rand_exercise(duration, category) @service.rand_exercise(duration, category) end