Sha256: 0ca20bafce26f1a386fd449690b9fc26e26c2725c642cfbe0ba4df806e13d440

Contents?: true

Size: 735 Bytes

Versions: 3

Compression:

Stored size: 735 Bytes

Contents

module FilmBuff
  class Title
    attr_accessor :imdb_id, :title, :tagline, :plot, :runtime, :rating, :votes,
      :poster_url, :genres, :release_date

    def initialize(options = {})
      @imdb_id = options["tconst"]
      @title = options["title"]
      @tagline = options["tagline"]
      @plot = options["plot"]["outline"] if options["plot"]
      @runtime = "#{(options["runtime"]["time"]/60).to_i} min" if
        options["runtime"]
      @rating = options["rating"]
      @votes = options["num_votes"]
      @poster_url = options["image"]["url"] if options["image"]
      @genres = options["genres"] || []
      @release_date = options["release_date"]["normal"] if
        options["release_date"]["normal"]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
filmbuff-0.1.2 lib/filmbuff/title.rb
filmbuff-0.1.1 lib/filmbuff/title.rb
filmbuff-0.1.0 lib/filmbuff/title.rb