Sha256: 908318c39adb0ca23318db95c1de6d68d4cb29acb169e62752219dd6b5a3fa95

Contents?: true

Size: 600 Bytes

Versions: 1

Compression:

Stored size: 600 Bytes

Contents

class NewMovies::Movie
  attr_accessor :title, :url, :runtime, :genre, :release_date, :cast, :director, :movie_site, :synopsis, :rating, :index

  @@all = []

  def initialize(title ,url)
    @title = title
    @url = url
    @@all << self
  end

  def attribute_assignment(movies_hash_attributes)
    movies_hash_attributes.each{|key, value| self.send(("#{key}="), value)}
  end

  def self.all
    @@all
  end

  def self.find_movie_by_index(index)
    movie = NewMovies::Movie.all[index.to_i - 1]
    movie.attribute_assignment(NewMovies::Scraper.scrape_movie_details(movie))
    movie
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
new_movies_cinemark-0.1.12 lib/new_movies/movie.rb