class GuideboxWrapper::Movie
Attributes
alternate_titles[R]
android_trailers[R]
backgrounds[RW]
cast[R]
directors[R]
duration[R]
facebook_link[R]
free_android_sources[R]
free_ios_sources[R]
free_web_sources[R]
freebase[R]
genres[R]
id[R]
imdb[R]
ios_trailers[R]
metacritic[R]
overview[R]
posters[RW]
purchase_android_sources[R]
purchase_ios_sources[R]
purchase_web_sources[R]
rating[R]
release_date[R]
release_year[R]
rottentomatoes[R]
subscription_web_sources[R]
themoviedb[R]
thumbnails[RW]
title[R]
tv_everywhere_android_sources[R]
tv_everywhere_ios_sources[R]
tv_everywhere_web_sources[R]
web_trailers[R]
wikipedia_id[R]
writers[R]
Public Class Methods
new(movie_info)
click to toggle source
# File lib/GuideboxWrapper/movie/movie.rb, line 6 def initialize(movie_info) excluded_keys = ["common_sense_media", "poster_120x171", "poster_240x342", "poster_400x570", "social", "trailers"] movie_info.each do |key, value| unless excluded_keys.include?(key) instance_variable_set("@#{key}", value) end end @facebook_link = movie_info["social"]["facebook"]["link"] @web_trailers = movie_info["trailers"]["web"] @ios_trailers = movie_info["trailers"]["ios"] @android_trailers = movie_info["trailers"]["android"] end
Public Instance Methods
images=(api_key)
click to toggle source
# File lib/GuideboxWrapper/movie/movie.rb, line 19 def images=(api_key) if @posters == nil wrapper = GuideboxWrapper::GuideboxMovie.new(api_key, "all") url = wrapper.base_url url += "/movie/" + @id.to_s + "/images/all" images = wrapper.client.query(url)["results"] @posters = images["posters"] @backgrounds = images["backgrounds"] @banners = images["banners"] @thumbnails = images["thumbnails"] end end
large_posters()
click to toggle source
# File lib/GuideboxWrapper/movie/movie.rb, line 32 def large_posters lg_posters ||= [] for poster in @posters lg_posters << poster["large"] end lg_posters end
large_thumbnails()
click to toggle source
# File lib/GuideboxWrapper/movie/movie.rb, line 96 def large_thumbnails lg_thumbnails ||= [] for thumbnail in @thumbnails lg_thumbnails << thumbnail["large"] end lg_thumbnails end
medium_posters()
click to toggle source
# File lib/GuideboxWrapper/movie/movie.rb, line 40 def medium_posters md_posters ||= [] for poster in @posters md_posters << poster["medium"] end md_posters end
medium_thumbnails()
click to toggle source
# File lib/GuideboxWrapper/movie/movie.rb, line 104 def medium_thumbnails md_thumbnails ||= [] for thumbnail in @thumbnails md_thumbnails << thumbnail["medium"] end md_thumbnails end
small_posters()
click to toggle source
# File lib/GuideboxWrapper/movie/movie.rb, line 48 def small_posters sm_posters ||= [] for poster in @posters sm_posters << poster["small"] end sm_posters end
small_thumbnails()
click to toggle source
# File lib/GuideboxWrapper/movie/movie.rb, line 112 def small_thumbnails sm_thumbnails ||= [] for thumbnail in @thumbnails sm_thumbnails << thumbnail["small"] end sm_thumbnails end
xlarge_thumbnails()
click to toggle source
# File lib/GuideboxWrapper/movie/movie.rb, line 88 def xlarge_thumbnails xlg_thumbnails ||= [] for thumbnail in @thumbnails xlg_thumbnails << thumbnail["xlarge"] end xlg_thumbnails end