class Year

Attributes

label[RW]
productions[RW]
scraped_list[RW]

Public Class Methods

all() click to toggle source
# File lib/Theatre_Explorer/year.rb, line 16
def self.all
    @@all
end
new(label, productions = []) click to toggle source
# File lib/Theatre_Explorer/year.rb, line 7
def initialize(label, productions = [])
    unless Year.find(label)
        @label = label
        @productions = productions
        @scraped_list = Scraper.new.year(self.label)
        @@all << self
    end
end

Public Instance Methods

display_productions() click to toggle source
# File lib/Theatre_Explorer/year.rb, line 20
def display_productions
    system("clear")
    puts "Broadway productions from #{@label}"
    puts "-------------------------------------------------"
        scraped_list.keys.each.with_index(1) do |production, i|
            puts "#{i}) \t#{production}"
        end
    puts "-------------------------------------------------"
end