class Top10BoxOffice::Movie

Attributes

gross[RW]
movie_details[RW]
title[RW]
url[RW]
weekend_total[RW]
weeks[RW]

Public Class Methods

all() click to toggle source
# File lib/top_10_box_office/movie.rb, line 29
def self.all
  @@all
end
date() click to toggle source
# File lib/top_10_box_office/movie.rb, line 25
def self.date
  @@date
end
find_or_get_details(idx) click to toggle source
# File lib/top_10_box_office/movie.rb, line 17
def self.find_or_get_details(idx)
  self.all[idx].movie_details ||= self.all[idx].get_details
end
new(attributes) click to toggle source
# File lib/top_10_box_office/movie.rb, line 6
def initialize(attributes)
  attributes.each { |key, value| self.send("#{key}=", value)}
  self.class.all << self
end
set_date(date) click to toggle source
# File lib/top_10_box_office/movie.rb, line 21
def self.set_date(date)
  @@date = date
end

Public Instance Methods

get_details() click to toggle source
# File lib/top_10_box_office/movie.rb, line 11
def get_details
  movie_profile = Top10BoxOffice::MovieDetails.new(Top10BoxOffice::Scraper.new.get_movie_details(url))
  movie_profile.movie = self
  movie_profile
end