Class: TvMaze::Schedule

Inherits:
ApiResource show all
Defined in:
lib/tv_maze/models/schedule.rb

Class Method Summary collapse

Class Method Details

.fetch(date: Date.today, country: 'US') ⇒ Object

The schedule is a complete list of episodes that air in a given country on a given date. Episodes are returned in the order in which they are aired, and full information about the episode and the corresponding show is included.



3
4
5
6
7
# File 'lib/tv_maze/models/schedule.rb', line 3

def self.fetch(date: Date.today, country: 'US')
  params = {country: country, date: date.to_date.strftime}

  build_collection(TvMaze::Requester.get("schedule", params), TvMaze::ScheduleRepresenter)
end

.fullObject

The full schedule is a list of all future episodes known to TVmaze



10
11
12
# File 'lib/tv_maze/models/schedule.rb', line 10

def self.full
  build_collection(TvMaze::Requester.get("schedule/full"), TvMaze::ScheduleRepresenter)
end