lib/kitchen/element_enumerator_base.rb
# Returns an enumerator that iterates through elements within the scope of this enumerator
#
# @param enumerator_class [ElementEnumeratorBase] the enumerator to use for the iteration
# @param default_css_or_xpath [String] the default CSS or xpath to use when iterating.  Normally,
#   this value is provided by the `enumerator_class`, but that isn't always the case, e.g.
#   when that class is a generic `ElementEnumerator`.
# @param css_or_xpath [String] additional selectors to further narrow the element iterated over
#   a "$" in this argument will be replaced with the default selector for the element being
#   iterated over.
# @param only [Symbol, Callable] the name of a method to call on an element or a
#   lambda or proc that accepts an element; elements will only be included in the
#   search results if the method or callable returns true
# @param except [Symbol, Callable] the name of a method to call on an element or a
#   lambda or proc that accepts an element; elements will not be included in the
#   search results if the method or callable returns false
#
Returns an enumerator that iterates through elements within the scope of this enumerator
Returns an enumerator that iterates through elements within the scope of this enumerator
def chain_to(enumerator_class, default_css_or_xpath: nil, css_or_xpath: nil,
                 only: nil, except: nil)
      block_error_if(block_given?)
      search_query = SearchQuery.new(
        css_or_xpath: css_or_xpath,
        only: only,
        except: except
      )
      if default_css_or_xpath
        search_query.apply_default_css_or_xpath_and_normalize(default_css_or_xpath)
      end
      enumerator_class.factory.build_within(self, search_query: search_query)
    end
def chain_to ( enumerator_class , default_css_or_xpath : nil , css_or_xpath : nil , only : nil , except : nil ) block_error_if ( block_given? ) search_query = SearchQuery . new ( css_or_xpath : css_or_xpath , only : only , except : except ) if default_css_or_xpath search_query . apply_default_css_or_xpath_and_normalize ( default_css_or_xpath ) end enumerator_class . factory . build_within ( self , search_query : search_query ) end
Returns an enumerator that iterates through elements within the scope of this enumerator
Returns an enumerator that iterates through elements within the scope of this enumerator
enumerator_class
the enumerator to use for the iteration
the enumerator to use for the iteration
default_css_or_xpath
the default CSS or xpath to use when iterating. Normally, this value is provided by the `enumerator_class`, but that isn't always the case, e.g. when that class is a generic `ElementEnumerator`.
the default CSS or xpath to use when iterating . Normally this value is provided by the ` enumerator_class ` but that isn ' t always the case e . g . when that class is a generic ` ElementEnumerator ` .
css_or_xpath
additional selectors to further narrow the element iterated over a "$" in this argument will be replaced with the default selector for the element being iterated over.
additional selectors to further narrow the element iterated over a " $ " in this argument will be replaced with the default selector for the element being iterated over .
only
the name of a method to call on an element or a lambda or proc that accepts an element; elements will only be included in the search results if the method or callable returns true
the name of a method to call on an element or a lambda or proc that accepts an element ; elements will only be included in the search results if the method or callable returns true
except
the name of a method to call on an element or a lambda or proc that accepts an element; elements will not be included in the search results if the method or callable returns false
the name of a method to call on an element or a lambda or proc that accepts an element ; elements will not be included in the search results if the method or callable returns false