Module: Taza::Site::Methods
- Defined in:
- lib/taza/site.rb
Overview
These methods are available for user contexts, including Site itself
Instance Attribute Summary collapse
-
#browser ⇒ Object
Returns the value of attribute browser.
-
#site ⇒ Object
Returns the value of attribute site.
Instance Method Summary collapse
-
#goto(relative_url) ⇒ Object
Send the browser to a url, relative to the site origin.
-
#page(page_name, &block) ⇒ Object
Return an instance of the specified page.
- #pages ⇒ Object
Instance Attribute Details
#browser ⇒ Object
Returns the value of attribute browser.
25 26 27 |
# File 'lib/taza/site.rb', line 25 def browser @browser end |
#site ⇒ Object
Returns the value of attribute site.
25 26 27 |
# File 'lib/taza/site.rb', line 25 def site @site end |
Instance Method Details
#goto(relative_url) ⇒ Object
Send the browser to a url, relative to the site origin.
37 38 39 40 |
# File 'lib/taza/site.rb', line 37 def goto relative_url destination = File.join(@site.origin, relative_url) @browser.goto destination end |
#page(page_name, &block) ⇒ Object
Return an instance of the specified page. The name Given should be the human-form of the page, without the “page” suffix. If a block is given, it yields to the page.
31 32 33 34 |
# File 'lib/taza/site.rb', line 31 def page(page_name, &block) method_name = page_name.computerize + '_page' send method_name, &block end |
#pages ⇒ Object
42 43 44 |
# File 'lib/taza/site.rb', line 42 def pages @pages || @site.pages end |