class AtxLiveMusic::Shows
Attributes
date[RW]
location[RW]
performance[RW]
venue[RW]
Public Class Methods
create_shows(date)
click to toggle source
# File lib/atx_live_music/shows.rb, line 13 def self.create_shows(date) page = Scraper.new(date.num_date) arr = page.doc.css("#AllListings") arr.each do |listing| i = 0 while i < listing.css("h2").count performance = listing.css("h2 a")[i].text venue = listing.css("h3 a")[i].text location = listing.css("h3 span")[i].text AtxLiveMusic::Shows.new(date, performance, venue, location) i += 1 end end end
new(date, performance, venue, location)
click to toggle source
# File lib/atx_live_music/shows.rb, line 5 def initialize(date, performance, venue, location) @date = date @performance = performance @location = location @venue = venue date.shows << self end