lib/page-object/accessors.rb
#
# adds a method to return a collection of page objects rooted at elements
#
# @example
#   page_sections(:articles, Article, :class => 'article')
#   # will generate 'articles'
#
# @param [Symbol] the name used for the generated method
# @param [Class] the class to instantiate for each element
# @param [Hash] identifier how we find an element.
#
adds a method to return a collection of page objects rooted at elements
adds a method to return a collection of page objects rooted at elements
def page_sections(name, section_class, identifier)
      define_method(name) do
        platform.pages_for(identifier, section_class)
      end
    end
def page_sections ( name , section_class , identifier ) define_method ( name ) do platform . pages_for ( identifier , section_class ) end end
adds a method to return a collection of page objects rooted at elements
adds a method to return a collection of page objects rooted at elements
name
section_class
identifier
identifier how we find an element.
identifier how we find an element .
example
articles, Article, :class => 'article') # will generate 'articles'
articles Article : class = > ' article ' ) # will generate ' articles '