Sha256: ae3c55cb7c58e605fd4d33960c2b01a05dbb7dcb6236ea87b4731ec5c8570379

Contents?: true

Size: 489 Bytes

Versions: 1

Compression:

Stored size: 489 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

    def initialize(data:)
      @imdb_id = data['imdbID']
      @title = data['Title']
      @year = data['Year']
      @actors = data['Actors']
      @poster = data['Poster']
      @plot = data['Plot']
    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.0 lib/movlog/movie.rb