lib/movlog/movie.rb in movlog-0.2.1 vs lib/movlog/movie.rb in movlog-0.2.2

- old
+ new

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