class NewMovies::Movie
Attributes
cast[RW]
director[RW]
genre[RW]
index[RW]
movie_site[RW]
rating[RW]
release_date[RW]
runtime[RW]
synopsis[RW]
title[RW]
url[RW]
Public Class Methods
all()
click to toggle source
# File lib/new_movies/movie.rb, line 16 def self.all @@all end
find_movie_by_index(index)
click to toggle source
# File lib/new_movies/movie.rb, line 20 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
new(title ,url)
click to toggle source
# File lib/new_movies/movie.rb, line 6 def initialize(title ,url) @title = title @url = url @@all << self end
Public Instance Methods
attribute_assignment(movies_hash_attributes)
click to toggle source
# File lib/new_movies/movie.rb, line 12 def attribute_assignment(movies_hash_attributes) movies_hash_attributes.each{|key, value| self.send(("#{key}="), value)} end