class TopTv::Heading

Attributes

name[RW]
shows[RW]

Public Class Methods

all() click to toggle source
# File lib/top_tv/heading.rb, line 19
def self.all
  @@all
end
new(name, shows) click to toggle source
# File lib/top_tv/heading.rb, line 13
def initialize(name, shows)
  @name = name
  @shows = shows
  @@all << self
end
new_from_home_page(heading) click to toggle source
# File lib/top_tv/heading.rb, line 6
def self.new_from_home_page(heading)
  self.new(
    heading.css("h2").text.gsub(" on RT", ""),
    heading.css("tr td.middle_col a").collect {|show| show.text.gsub(" View All ", "").gsub(",", "")}.join(",").split(",")
  )
end