lib/kitchen/element_enumerator_factory.rb
# Builds a new enumerator within the scope of the provided argument (either
# an enumerator or a class).  Accepts optional selectors to further limit
# the scope of results found.
#
# @param enumerator_or_element [ElementEnumeratorBase, ElementBase] the object
#   within which to iterate
# @param search_query [SearchQuery] search directives to limit iteration results
# @return [ElementEnumeratorBase] actually returns the concrete enumerator class
#   given to the factory in its constructor.
#
Builds a new enumerator within the scope of the provided argument (either
an enumerator or a class).  Accepts optional selectors to further limit
the scope of results found.
Builds a new enumerator within the scope of the provided argument ( either an enumerator or a class ) . Accepts optional selectors to further limit the scope of results found .
def build_within(enumerator_or_element, search_query: SearchQuery.new, reload: false)
      case enumerator_or_element
      when ElementBase
        build_within_element(enumerator_or_element,
                             search_query: search_query,
                             reload: reload)
      when ElementEnumeratorBase
        if enumerator_class != ElementEnumerator && !search_query.expects_substitution?
          raise "Query #{search_query} is missing the substitution character ('$') but " \
                "is run with an enumerator #{enumerator_class.name} that has its own " \
                "selectors for substitution."
        end
        build_within_other_enumerator(enumerator_or_element,
                                      search_query: search_query,
                                      reload: reload)
      end
    end
def build_within ( enumerator_or_element , search_query : SearchQuery . new , reload : false ) case enumerator_or_element when ElementBase build_within_element ( enumerator_or_element , search_query : search_query , reload : reload ) when ElementEnumeratorBase if enumerator_class != ElementEnumerator && ! search_query . expects_substitution? raise "Query #{search_query} is missing the substitution character ('$') but " "is run with an enumerator #{enumerator_class.name} that has its own " "selectors for substitution." end build_within_other_enumerator ( enumerator_or_element , search_query : search_query , reload : reload ) end end
Builds a new enumerator within the scope of the provided argument (either
an enumerator or a class).
Builds a new enumerator within the scope of the provided argument ( either an enumerator or a class ) .
actually returns the concrete enumerator class given to the factory in its constructor.
actually returns the concrete enumerator class given to the factory in its constructor .
ElementEnumeratorBase
enumerator_or_element
the object within which to iterate
the object within which to iterate
search_query
search directives to limit iteration results
search directives to limit iteration results
new
<not_specific>
reload
<not_specific>