Class: PAX::Event
- Inherits:
-
Object
- Object
- PAX::Event
- Defined in:
- lib/pax/event.rb
Instance Method Summary collapse
- #available? ⇒ Boolean
-
#initialize(location) ⇒ Event
constructor
A new instance of Event.
- #registration_closed? ⇒ Boolean
- #registration_open? ⇒ Boolean
- #site ⇒ Object
- #sold_out? ⇒ Boolean
Constructor Details
#initialize(location) ⇒ Event
Returns a new instance of Event.
5 6 7 |
# File 'lib/pax/event.rb', line 5 def initialize(location) @site = Mechanize.new.get("http://#{location}.paxsite.com/") end |
Instance Method Details
#available? ⇒ Boolean
25 26 27 |
# File 'lib/pax/event.rb', line 25 def available? !sold_out? end |
#registration_closed? ⇒ Boolean
17 18 19 |
# File 'lib/pax/event.rb', line 17 def registration_closed? !registration_open? end |
#registration_open? ⇒ Boolean
13 14 15 |
# File 'lib/pax/event.rb', line 13 def registration_open? @site.search(".registration").to_html =~ /open/ ? true : false end |
#site ⇒ Object
9 10 11 |
# File 'lib/pax/event.rb', line 9 def site @site.body end |
#sold_out? ⇒ Boolean
21 22 23 |
# File 'lib/pax/event.rb', line 21 def sold_out? @site.search(".soldOut").to_html =~ /Sold Out/ ? true : false end |