Class: SitePrism::Section
- Inherits:
-
Object
- Object
- SitePrism::Section
- Extended by:
- ElementContainer
- Includes:
- Capybara::DSL, ElementChecker
- Defined in:
- lib/site_prism/section.rb
Instance Attribute Summary collapse
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#root_element ⇒ Object
readonly
Returns the value of attribute root_element.
Instance Method Summary collapse
- #evaluate_script(input) ⇒ Object
- #execute_script(input) ⇒ Object
-
#initialize(parent, root_element) ⇒ Section
constructor
A new instance of Section.
- #parent_page ⇒ Object
- #visible? ⇒ Boolean
Methods included from ElementContainer
add_to_mapped_items, element, elements, iframe, mapped_items, section, sections
Methods included from ElementChecker
Constructor Details
#initialize(parent, root_element) ⇒ Section
Returns a new instance of Section.
9 10 11 |
# File 'lib/site_prism/section.rb', line 9 def initialize parent, root_element @parent, @root_element = parent, root_element end |
Instance Attribute Details
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
7 8 9 |
# File 'lib/site_prism/section.rb', line 7 def parent @parent end |
#root_element ⇒ Object (readonly)
Returns the value of attribute root_element.
7 8 9 |
# File 'lib/site_prism/section.rb', line 7 def root_element @root_element end |
Instance Method Details
#evaluate_script(input) ⇒ Object
21 22 23 |
# File 'lib/site_prism/section.rb', line 21 def evaluate_script input Capybara.current_session.evaluate_script input end |
#execute_script(input) ⇒ Object
17 18 19 |
# File 'lib/site_prism/section.rb', line 17 def execute_script input Capybara.current_session.execute_script input end |
#parent_page ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/site_prism/section.rb', line 25 def parent_page candidate_page = self.parent until candidate_page.is_a?(SitePrism::Page) candidate_page = candidate_page.parent end candidate_page end |
#visible? ⇒ Boolean
13 14 15 |
# File 'lib/site_prism/section.rb', line 13 def visible? root_element.visible? end |