Class: Moto::Page
Instance Method Summary collapse
- #const(key) ⇒ Object
-
#initialize(website) ⇒ Page
constructor
A new instance of Page.
- #page(p) ⇒ Object
- #raise_unless_loaded ⇒ Object
- #session ⇒ Object
Methods included from TestLogging
Constructor Details
#initialize(website) ⇒ Page
Returns a new instance of Page.
10 11 12 13 |
# File 'lib/page.rb', line 10 def initialize(website) @website = website @context = @website.context end |
Instance Method Details
#const(key) ⇒ Object
15 16 17 |
# File 'lib/page.rb', line 15 def const(key) @website.context.const(key) end |
#page(p) ⇒ Object
23 24 25 |
# File 'lib/page.rb', line 23 def page(p) @context.client(@website.class.name.split('::').pop).page(p) end |
#raise_unless_loaded ⇒ Object
27 28 29 |
# File 'lib/page.rb', line 27 def raise_unless_loaded raise "Invalid state: page #{self.class.name} is not loaded." unless loaded? end |
#session ⇒ Object
19 20 21 |
# File 'lib/page.rb', line 19 def session @website.session end |