Module: SeriesTimer::SeriesManager
- Defined in:
- lib/series_timer/series_manager.rb
Class Method Summary collapse
- .all_episodes(serie, options) ⇒ Object
- .last_episode(serie, options) ⇒ Object
- .next_episode(serie, options) ⇒ Object
Class Method Details
.all_episodes(serie, options) ⇒ Object
20 21 22 |
# File 'lib/series_timer/series_manager.rb', line 20 def all_episodes(serie, ) Crawler.get_episodes(serie, ).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, ) episodes = Crawler.get_episodes(serie, ) 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, ) episode = get_next_episode(serie, ) return if episode.nil? episode.to_s end |