Class: TmdbInfo
- Inherits:
-
Object
- Object
- TmdbInfo
- Defined in:
- lib/dvdprofiler2xbmc/models/tmdb_info.rb
Class Method Summary collapse
-
.find(options) ⇒ Object
Synopsis load data from themovieDb.com see TmdbProfile.all for options.
Instance Method Summary collapse
-
#to_xbmc_info ⇒ Object
Synopsis map the tmdb.movie hash into the info hash.
Class Method Details
.find(options) ⇒ Object
Synopsis
load data from themovieDb.com see TmdbProfile.all for options
14 15 16 17 18 19 20 21 |
# File 'lib/dvdprofiler2xbmc/models/tmdb_info.rb', line 14 def self.find() tmdb_info = nil profile = TmdbProfile.first() unless profile.nil? tmdb_info = TmdbInfo.new(profile) end tmdb_info end |
Instance Method Details
#to_xbmc_info ⇒ Object
Synopsis
map the tmdb.movie hash into the info hash
45 46 47 48 49 50 51 52 53 |
# File 'lib/dvdprofiler2xbmc/models/tmdb_info.rb', line 45 def to_xbmc_info info = Hash.new unless @profile.movie.blank? TMDB_HASH_TO_INFO_MAP.each do |key, value| info[value] = @profile.movie[key].first unless @profile.movie[key].blank? end end info end |