class Showtimes::Theater
Attributes
movies[RW]
name[RW]
Public Class Methods
all()
click to toggle source
# File lib/showtimes/theater.rb, line 24 def self.all @@all_theaters end
clear()
click to toggle source
# File lib/showtimes/theater.rb, line 28 def self.clear @@all_theaters.clear end
new(name = nil, movies = nil)
click to toggle source
# File lib/showtimes/theater.rb, line 7 def initialize(name = nil, movies = nil) @name = name @movies = movies @@all_theaters << self end
new_from_index_page(showtimes)
click to toggle source
# File lib/showtimes/theater.rb, line 13 def self.new_from_index_page(showtimes) movies = [] showtimes.css(".showtimes .movie").each do |movie| movies << { movie_name: movie.css(".name a").text, movie_times: movie.css(".times").text.split("  ") } end self.new(showtimes.css("h2.name a").text, movies) end