Sha256: 4c07823e5c98591f6338d5433d92d13ffd5ce8500638ada64067153e92ff91c2

Contents?: true

Size: 636 Bytes

Versions: 6

Compression:

Stored size: 636 Bytes

Contents

# frozen_string_literal: true
require_relative 'omdb_api'

module Movlog
  # Movie info
  class Movie
    attr_reader :imdb_id, :title, :year, :actors, :poster, :plot, :location

    def initialize(data:,location:)
      @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)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
movlog-0.2.7 lib/movlog/movie.rb
movlog-0.2.6 lib/movlog/movie.rb
movlog-0.2.5 lib/movlog/movie.rb
movlog-0.2.4 lib/movlog/movie.rb
movlog-0.2.3 lib/movlog/movie.rb
movlog-0.2.2 lib/movlog/movie.rb