Sha256: 039f8ebe8b62744f2bacff1de78a75d6f70a8508e13f70397b61cecd3d03ba60

Contents?: true

Size: 535 Bytes

Versions: 1

Compression:

Stored size: 535 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, :response

    def initialize(data:)
      @imdb_id = data['imdbID']
      @title = data['Title']
      @year = data['Year']
      @actors = data['Actors']
      @poster = data['Poster']
      @plot = data['Plot']
      @response = data['Response']
    end

    def self.find(t:)
      movie_data = OmdbApi.movie_info(t)
      new(data: movie_data)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
movlog-0.2.1 lib/movlog/movie.rb