Class: RedRocks::Concert
- Inherits:
-
Object
- Object
- RedRocks::Concert
- Defined in:
- lib/red_rocks/concert.rb
Instance Attribute Summary collapse
-
#date ⇒ Object
Returns the value of attribute date.
-
#name ⇒ Object
Returns the value of attribute name.
-
#opener ⇒ Object
Returns the value of attribute opener.
-
#tickets_URL ⇒ Object
Returns the value of attribute tickets_URL.
-
#time ⇒ Object
Returns the value of attribute time.
Class Method Summary collapse
Instance Attribute Details
#date ⇒ Object
Returns the value of attribute date.
2 3 4 |
# File 'lib/red_rocks/concert.rb', line 2 def date @date end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/red_rocks/concert.rb', line 2 def name @name end |
#opener ⇒ Object
Returns the value of attribute opener.
2 3 4 |
# File 'lib/red_rocks/concert.rb', line 2 def opener @opener end |
#tickets_URL ⇒ Object
Returns the value of attribute tickets_URL.
2 3 4 |
# File 'lib/red_rocks/concert.rb', line 2 def tickets_URL @tickets_URL end |
#time ⇒ Object
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_show ⇒ Object
4 5 6 |
# File 'lib/red_rocks/concert.rb', line 4 def self.next_show self.scrape_concert end |
.scrape_concert ⇒ Object
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 |