Module: Traktr::User::Calendar
- Includes:
- HTTParty
- Defined in:
- lib/traktr/user/calendar.rb
Class Method Summary collapse
Class Method Details
.shows(username = Traktr.username, date = Date.today, days = 7) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/traktr/user/calendar.rb', line 7 def self.shows(username = Traktr.username, date = Date.today, days = 7) date = date.strftime('%Y%m%d') if date.class == Date response = self.get('/' + File.join('shows.json', Traktr.api_key, username, date, days.to_s)) raise ResponseError.new(response) if response.code != 200 response.parsed_response.collect do |item| Mash.new(item) end end |