Module: SeriesTimer::SeriesManager

Defined in:
lib/series_timer/series_manager.rb

Class Method Summary collapse

Class Method Details

.all_episodes(serie, options) ⇒ Object



20
21
22
# File 'lib/series_timer/series_manager.rb', line 20

def all_episodes(serie, options)
  Crawler.get_episodes(serie, options).map(&:to_s)
end

.last_episode(serie, options) ⇒ Object



13
14
15
16
17
18
# File 'lib/series_timer/series_manager.rb', line 13

def last_episode(serie, options)
  episodes = Crawler.get_episodes(serie, options)
  episodes.reject! { |episode| episode.date >= Date.today }
  return if episodes.nil?
  episodes.last.to_s
end

.next_episode(serie, options) ⇒ Object



7
8
9
10
11
# File 'lib/series_timer/series_manager.rb', line 7

def next_episode(serie, options)
  episode = get_next_episode(serie, options)
  return if episode.nil?
  episode.to_s
end