Module: Traktr::User::Calendar
- Includes:
- HTTParty
- Defined in:
- lib/traktr/user/calendar.rb
Instance Method Summary collapse
Instance Method Details
#shows(username = @client.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 shows(username = @client.username, date = Date.today, days = 7) date = date.strftime('%Y%m%d') if date.class == Date response = self.class.get('/' + File.join('shows.json', @client.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 |