Class: Mediaman::Trakt::TVEpisode
Instance Attribute Summary collapse
Attributes inherited from Fetcher
#options, #response
Instance Method Summary
collapse
Methods inherited from Fetcher
from_hash, #initialize
Instance Attribute Details
#show ⇒ Object
Returns the value of attribute show.
49
50
51
|
# File 'lib/mediaman/trakt.rb', line 49
def show
@show
end
|
Instance Method Details
#fetch! ⇒ Object
51
52
53
54
55
56
|
# File 'lib/mediaman/trakt.rb', line 51
def fetch!
url = "http://api.trakt.tv/show/episode/summary.json/#{Trakt.api_key}/#{slug}"
self.response = r = self.class.get(url)
self.show = Trakt::TVShow.from_hash self.response['show']
self.response['episode']
end
|
#slug ⇒ Object
58
59
60
|
# File 'lib/mediaman/trakt.rb', line 58
def slug
options[:slug].presence || "#{title_slug}/#{options[:season_number]}/#{options[:episode_number]}"
end
|
#title_slug ⇒ Object
62
63
64
|
# File 'lib/mediaman/trakt.rb', line 62
def title_slug
options[:title_slug].presence || "#{options[:show_title].parameterize}"
end
|