Class: PAX::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/pax/event.rb

Instance Method Summary collapse

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

Returns:

  • (Boolean)


25
26
27
# File 'lib/pax/event.rb', line 25

def available?
  !sold_out?
end

#registration_closed?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/pax/event.rb', line 17

def registration_closed?
  !registration_open?
end

#registration_open?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/pax/event.rb', line 13

def registration_open?
  @site.search(".registration").to_html =~ /open/ ? true : false
end

#siteObject



9
10
11
# File 'lib/pax/event.rb', line 9

def site
  @site.body
end

#sold_out?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/pax/event.rb', line 21

def sold_out?
  @site.search(".soldOut").to_html =~ /Sold Out/ ? true : false
end