Class: Mediaman::Trakt::Movie

Inherits:
Fetcher
  • Object
show all
Defined in:
lib/mediaman/trakt.rb

Instance Attribute Summary

Attributes inherited from Fetcher

#options, #response

Instance Method Summary collapse

Methods inherited from Fetcher

from_hash, #initialize

Constructor Details

This class inherits a constructor from Mediaman::Trakt::Fetcher

Instance Method Details

#fetch!Object



41
42
43
# File 'lib/mediaman/trakt.rb', line 41

def fetch!
  Movie.get("http://api.trakt.tv/movie/summary.json/#{Trakt.api_key}/#{slug}")
end

#slugObject



37
38
39
# File 'lib/mediaman/trakt.rb', line 37

def slug
  options[:slug].presence || "#{options[:title].parameterize}-#{options[:year].to_s.parameterize}"
end