lib/movlog/movie.rb in movlog-0.2.8 vs lib/movlog/movie.rb in movlog-0.2.9

- old
+ new

@@ -4,23 +4,25 @@ module Movlog # Movie info class Movie attr_reader :imdb_id, :title, :year, :actors, :poster, :plot, :location - def initialize(data:,location:) + def initialize(data:) @imdb_id = data['imdbID'] @title = data['Title'] @year = data['Year'] @actors = data['Actors'] @poster = data['Poster'] @plot = data['Plot'] - #@location = location end def self.find(t:) movie_data = OmdbApi.movie_info(t) - imdb_id = movie_data['imdbID'] - location = OmdbApi.location(imdb_id) - new(data: movie_data,location: location) + new(data: movie_data) + end + + def get_location + return @location if @location + @location = OmdbApi.location(@imdb_id) end end end