class BerkleeValencia::PROGRAM

Attributes

highlights[RW]
i[RW]
introduction[RW]
subtitle[RW]
type[RW]

Public Class Methods

all() click to toggle source
# File lib/berklee_valencia/program.rb, line 34
def self.all
  @@all
end
find_by_index(input) click to toggle source
# File lib/berklee_valencia/program.rb, line 22
def self.find_by_index(input)
  @@all.detect{|program| program.i == input}
end
graduate_programs() click to toggle source
# File lib/berklee_valencia/program.rb, line 26
def self.graduate_programs
  @@graduate_programs
end
new_from_scraper(attribute_hash) click to toggle source
# File lib/berklee_valencia/program.rb, line 7
def self.new_from_scraper(attribute_hash)
  BerkleeValencia::PROGRAM.new(attribute_hash[:title], attribute_hash[:url]).tap do |program|
    program.type = attribute_hash[:type]
    program.subtitle = attribute_hash[:subtitle]
    program.i = @@all.length + 1
    @@all << program
    program.type == "Graduate Programs" ? @@graduate_programs << program : @@other_programs << program
  end
end
other_programs() click to toggle source
# File lib/berklee_valencia/program.rb, line 30
def self.other_programs
  @@other_programs
end

Public Instance Methods

extended_info_from_scraper(attribute_hash) click to toggle source
# File lib/berklee_valencia/program.rb, line 17
def extended_info_from_scraper(attribute_hash)
  @highlights = attribute_hash[:highlights]
  @introduction = attribute_hash[:introduction]
end