Class: Wod::DevCenterPage

Inherits:
Object
  • Object
show all
Defined in:
lib/wod/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page) ⇒ DevCenterPage

Returns a new instance of DevCenterPage.



10
11
12
# File 'lib/wod/client.rb', line 10

def initialize page
  @page = page
end

Instance Attribute Details

#pageObject (readonly)

Returns the value of attribute page.



8
9
10
# File 'lib/wod/client.rb', line 8

def page
  @page
end

Instance Method Details

#form(arg) ⇒ Object



26
27
28
# File 'lib/wod/client.rb', line 26

def form arg
  @page.form arg
end

#logged_in?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/wod/client.rb', line 14

def logged_in?
  (page.title =~ /sign in/i) == nil && (page.search("span").find {|s| s.text == "Log in"}) == nil
end

#search(arg) ⇒ Object



22
23
24
# File 'lib/wod/client.rb', line 22

def search arg
  @page.search arg
end

#team_selection_page?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/wod/client.rb', line 18

def team_selection_page?
  (page.title =~ /select.*team/i)
end