Class: TMDBParty::Movie

Inherits:
Object
  • Object
show all
Includes:
Attributes
Defined in:
lib/tmdb_party/movie.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Attributes

included

Constructor Details

#initialize(values, tmdb) ⇒ Movie

Returns a new instance of Movie.



17
18
19
20
# File 'lib/tmdb_party/movie.rb', line 17

def initialize(values, tmdb)
  @tmdb = tmdb
  self.attributes = values
end

Instance Attribute Details

#tmdbObject (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

#actorsObject



32
33
34
# File 'lib/tmdb_party/movie.rb', line 32

def actors
  find_people('actor')
end

#directorsObject



28
29
30
# File 'lib/tmdb_party/movie.rb', line 28

def directors
  find_people('director')
end

#get_info!Object



22
23
24
25
26
# File 'lib/tmdb_party/movie.rb', line 22

def get_info!
  movie = tmdb.get_info(self.id)
  @attributes.merge!(movie.attributes) if movie
  @loaded = true
end

#writersObject



36
37
38
# File 'lib/tmdb_party/movie.rb', line 36

def writers
  find_people('writer')
end