Class: TMDBParty::Movie
- Inherits:
-
Object
- Object
- TMDBParty::Movie
- Includes:
- Attributes
- Defined in:
- lib/tmdb_party/movie.rb
Instance Attribute Summary collapse
-
#tmdb ⇒ Object
readonly
Returns the value of attribute tmdb.
Instance Method Summary collapse
- #actors ⇒ Object
- #backdrops ⇒ Object
- #directors ⇒ Object
- #flattened_backdrops ⇒ Object
- #flattened_posters ⇒ Object
- #get_info! ⇒ Object
-
#initialize(values, tmdb) ⇒ Movie
constructor
A new instance of Movie.
- #posters ⇒ Object
- #writers ⇒ Object
Methods included from Attributes
Constructor Details
#initialize(values, tmdb) ⇒ Movie
Returns a new instance of Movie.
21 22 23 24 |
# File 'lib/tmdb_party/movie.rb', line 21 def initialize(values, tmdb) @tmdb = tmdb self.attributes = values end |
Instance Attribute Details
#tmdb ⇒ Object (readonly)
Returns the value of attribute tmdb.
4 5 6 |
# File 'lib/tmdb_party/movie.rb', line 4 def tmdb @tmdb end |
Instance Method Details
#actors ⇒ Object
36 37 38 |
# File 'lib/tmdb_party/movie.rb', line 36 def actors find_cast('Actor') end |
#backdrops ⇒ Object
48 49 50 |
# File 'lib/tmdb_party/movie.rb', line 48 def backdrops process_art(flattened_backdrops) end |
#directors ⇒ Object
32 33 34 |
# File 'lib/tmdb_party/movie.rb', line 32 def directors find_cast('Director') end |
#flattened_backdrops ⇒ Object
19 |
# File 'lib/tmdb_party/movie.rb', line 19 alias_method :flattened_backdrops, :backdrops |
#flattened_posters ⇒ Object
18 |
# File 'lib/tmdb_party/movie.rb', line 18 alias_method :flattened_posters, :posters |
#get_info! ⇒ Object
26 27 28 29 30 |
# File 'lib/tmdb_party/movie.rb', line 26 def get_info! movie = tmdb.get_info(self.id) @attributes.merge!(movie.attributes) if movie @loaded = true end |
#posters ⇒ Object
44 45 46 |
# File 'lib/tmdb_party/movie.rb', line 44 def posters process_art(flattened_posters) end |
#writers ⇒ Object
40 41 42 |
# File 'lib/tmdb_party/movie.rb', line 40 def writers find_cast('Writer') end |