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

Instance Method Summary collapse

Instance Attribute Details

#browserObject

Returns the value of attribute browser.



25
26
27
# File 'lib/taza/site.rb', line 25

def browser
  @browser
end

#siteObject

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

#pagesObject



42
43
44
# File 'lib/taza/site.rb', line 42

def pages
  @pages || @site.pages
end