Class: RedRocks::Concert

Inherits:
Object
  • Object
show all
Defined in:
lib/red_rocks/concert.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#dateObject

Returns the value of attribute date.



2
3
4
# File 'lib/red_rocks/concert.rb', line 2

def date
  @date
end

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/red_rocks/concert.rb', line 2

def name
  @name
end

#openerObject

Returns the value of attribute opener.



2
3
4
# File 'lib/red_rocks/concert.rb', line 2

def opener
  @opener
end

#tickets_URLObject

Returns the value of attribute tickets_URL.



2
3
4
# File 'lib/red_rocks/concert.rb', line 2

def tickets_URL
  @tickets_URL
end

#timeObject

Returns the value of attribute time.



2
3
4
# File 'lib/red_rocks/concert.rb', line 2

def time
  @time
end

Class Method Details

.next_showObject



4
5
6
# File 'lib/red_rocks/concert.rb', line 4

def self.next_show
  self.scrape_concert
end

.scrape_concertObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/red_rocks/concert.rb', line 8

def self.scrape_concert
  doc = Nokogiri::HTML(open("https://www.redrocksonline.com/"))
  concert = self.new
  concert.name = doc.search("h1.summary").text
  concert.opener = doc.search("h2").text
  concert.date = doc.search("span.m-date__singleDate").first.text
  concert.time = doc.search("span.m-doors").first.text.gsub("Doors","").strip
  concert.tickets_URL = doc.search("div.m-ticket a").attr("href").text

  concert
end