Class: Tmdb::Company

Inherits:
Struct show all
Defined in:
lib/tmdb/company.rb

Class Method Summary collapse

Methods inherited from Struct

#analyze_value, #initialize

Constructor Details

This class inherits a constructor from Tmdb::Struct

Class Method Details

.detail(id, filters = {}) ⇒ Object



4
5
6
7
# File 'lib/tmdb/company.rb', line 4

def self.detail(id, filters={})
  result = Resource.new("/company/#{id}", filters).get
  self.new(result)
end

.movies(id, filters = {}) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/tmdb/company.rb', line 9

def self.movies(id, filters={})
  result = Resource.new("/company/#{id}/movies", filters).get

  company = self.new(result.except('results'))
  company.results = result['results'].map do |movie|
    Movie.new(movie)
  end

  company
end