Class: Tmdb::Movie
Class Method Summary
collapse
-
.alternative_titles(id, filters = {}) ⇒ Object
-
.backdrops(id, filters = {}) ⇒ Object
-
.cast(id, filters = {}) ⇒ Object
-
.changes(id, filters = {}) ⇒ Object
-
.crew(id, filters = {}) ⇒ Object
-
.detail(id, filters = {}) ⇒ Object
-
.director(id, filters = {}) ⇒ Object
-
.keywords(id, filters = {}) ⇒ Object
-
.latest(filters = {}) ⇒ Object
-
.lists(id, filters = {}) ⇒ Object
-
.now_playing(filters = {}) ⇒ Object
-
.popular(filters = {}) ⇒ Object
-
.posters(id, filters = {}) ⇒ Object
-
.recommendations(id, filters = {}) ⇒ Object
-
.releases(id, filters = {}) ⇒ Object
-
.reviews(id, filters = {}) ⇒ Object
-
.similar(id, filters = {}) ⇒ Object
-
.top_rated(filters = {}) ⇒ Object
-
.translations(id, filters = {}) ⇒ Object
-
.upcoming(filters = {}) ⇒ Object
-
.videos(id, filters = {}) ⇒ Object
Methods inherited from Struct
#analyze_value, #initialize
Constructor Details
This class inherits a constructor from Tmdb::Struct
Class Method Details
.alternative_titles(id, filters = {}) ⇒ Object
10
11
12
13
14
15
16
|
# File 'lib/tmdb/movie.rb', line 10
def self.alternative_titles(id, filters={})
result = Resource.new("/movie/#{id}/alternative_titles", filters).get
result['titles'].map do |entry|
self.new(entry)
end
end
|
.backdrops(id, filters = {}) ⇒ Object
42
43
44
45
46
47
48
|
# File 'lib/tmdb/movie.rb', line 42
def self.backdrops(id, filters={})
result = Resource.new("/movie/#{id}/images", filters).get
result['backdrops'].map do |entry|
Backdrop.new(entry)
end
end
|
.cast(id, filters = {}) ⇒ Object
18
19
20
21
22
23
24
|
# File 'lib/tmdb/movie.rb', line 18
def self.cast(id, filters={})
result = Resource.new("/movie/#{id}/credits", filters).get
result['cast'].map do |entry|
Person.new(entry)
end
end
|
.changes(id, filters = {}) ⇒ Object
110
111
112
113
114
115
116
117
118
|
# File 'lib/tmdb/movie.rb', line 110
def self.changes(id, filters={})
result = Resource.new("/movie/#{id}/changes", filters).get
result['changes'].map do |entry|
change = Change.new(entry)
change.convert_items!
change
end
end
|
.crew(id, filters = {}) ⇒ Object
26
27
28
29
30
31
32
|
# File 'lib/tmdb/movie.rb', line 26
def self.crew(id, filters={})
result = Resource.new("/movie/#{id}/credits", filters).get
result['crew'].map do |entry|
Person.new(entry)
end
end
|
.detail(id, filters = {}) ⇒ Object
4
5
6
7
8
|
# File 'lib/tmdb/movie.rb', line 4
def self.detail(id, filters={})
result = Resource.new("/movie/#{id}", filters).get
create_new_instance_with_normalized_data(result)
end
|
.director(id, filters = {}) ⇒ Object
34
35
36
37
38
39
40
|
# File 'lib/tmdb/movie.rb', line 34
def self.director(id, filters={})
result = Resource.new("/movie/#{id}/credits", filters).get
result['crew'].select{ |x| x['job'] == 'Director' }.map do |entry|
Person.new(entry)
end
end
|
.keywords(id, filters = {}) ⇒ Object
66
67
68
69
70
71
72
|
# File 'lib/tmdb/movie.rb', line 66
def self.keywords(id, filters={})
result = Resource.new("/movie/#{id}/keywords", filters).get
result['keywords'].map do |entry|
Keyword.new(entry)
end
end
|
.latest(filters = {}) ⇒ Object
120
121
122
123
124
|
# File 'lib/tmdb/movie.rb', line 120
def self.latest(filters={})
result = Resource.new('/movie/latest', filters).get
create_new_instance_with_normalized_data(result)
end
|
.lists(id, filters = {}) ⇒ Object
105
106
107
108
|
# File 'lib/tmdb/movie.rb', line 105
def self.lists(id, filters={})
result = Resource.new("/movie/#{id}/lists", filters).get
Tmdb::List.new(result)
end
|
.now_playing(filters = {}) ⇒ Object
131
132
133
134
|
# File 'lib/tmdb/movie.rb', line 131
def self.now_playing(filters={})
result = Resource.new('/movie/now_playing', filters).get
self.new(result)
end
|
.popular(filters = {}) ⇒ Object
136
137
138
139
|
# File 'lib/tmdb/movie.rb', line 136
def self.popular(filters={})
result = Resource.new('/movie/popular', filters).get
self.new(result)
end
|
.posters(id, filters = {}) ⇒ Object
50
51
52
53
54
55
56
|
# File 'lib/tmdb/movie.rb', line 50
def self.posters(id, filters={})
result = Resource.new("/movie/#{id}/images", filters).get
result['posters'].map do |entry|
Poster.new(entry)
end
end
|
.recommendations(id, filters = {}) ⇒ Object
95
96
97
98
|
# File 'lib/tmdb/movie.rb', line 95
def self.recommendations(id, filters={})
result = Resource.new("/movie/#{id}/recommendations", filters).get
Recommendation.new(result)
end
|
.releases(id, filters = {}) ⇒ Object
74
75
76
77
78
79
80
|
# File 'lib/tmdb/movie.rb', line 74
def self.releases(id, filters={})
result = Resource.new("/movie/#{id}/releases", filters).get
result['countries'].map do |entry|
Release.new(entry)
end
end
|
.reviews(id, filters = {}) ⇒ Object
100
101
102
103
|
# File 'lib/tmdb/movie.rb', line 100
def self.reviews(id, filters={})
result = Resource.new("/movie/#{id}/reviews", filters).get
Review.new(result)
end
|
.similar(id, filters = {}) ⇒ Object
90
91
92
93
|
# File 'lib/tmdb/movie.rb', line 90
def self.similar(id, filters={})
result = Resource.new("/movie/#{id}/similar", filters).get
self.new(result)
end
|
.top_rated(filters = {}) ⇒ Object
141
142
143
144
|
# File 'lib/tmdb/movie.rb', line 141
def self.top_rated(filters={})
result = Resource.new('/movie/top_rated', filters).get
self.new(result)
end
|
.translations(id, filters = {}) ⇒ Object
82
83
84
85
86
87
88
|
# File 'lib/tmdb/movie.rb', line 82
def self.translations(id, filters={})
result = Resource.new("/movie/#{id}/translations", filters).get
result['translations'].map do |entry|
Translation.new(entry)
end
end
|
.upcoming(filters = {}) ⇒ Object
126
127
128
129
|
# File 'lib/tmdb/movie.rb', line 126
def self.upcoming(filters={})
result = Resource.new('/movie/upcoming', filters).get
self.new(result)
end
|
.videos(id, filters = {}) ⇒ Object
58
59
60
61
62
63
64
|
# File 'lib/tmdb/movie.rb', line 58
def self.videos(id, filters={})
result = Resource.new("/movie/#{id}/videos", filters).get
result['results'].map do |entry|
Video.new(entry)
end
end
|