Class: Play::Tmdb::Movie
- Inherits:
-
Object
- Object
- Play::Tmdb::Movie
- Defined in:
- lib/play-tmdb/movie.rb
Class Method Summary collapse
Class Method Details
.new(raw_data, fetch_all_data = false, language = nil) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/play-tmdb/movie.rb', line 4 def self.new(raw_data, fetch_all_data = false, language = nil) # expand the result by calling Movie.getInfo unless :expand_results is false or the data is already complete # (as determined by checking for the trailer property in the raw data) if (fetch_all_data) #Call getInfo end DeepOpenStruct.load(raw_data) end |
.search(params = {}) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/play-tmdb/movie.rb', line 15 def self.search(params={}) if !params[:query] or params[:query].empty? raise ArgumentError.new("query param is required") end body = Play::Tmdb::Base.api_call("search/movie", params) results = body.results.map do |r| new(r) end results end |