Sha256: e5efce11b50ed5341fdd98e4fcbfbd9f93cdb58f8fb31141af35cdc97eaa10ea

Contents?: true

Size: 711 Bytes

Versions: 12

Compression:

Stored size: 711 Bytes

Contents

# frozen_string_literal: true

module PageMagic
  class Element
    class Query
      # class PrefetchedResult - used to return element that has already been retrieved
      class PrefetchedResult < Query
        def initialize(prefetched_element)
          super
          @prefetched_element = prefetched_element
        end

        # Returns the object provided to `initialize`
        # The supplied block will be used to decorate the results
        # @return [Capybara::Node::Element] the object supplied to `initialize`
        def find(_capybara_element, &block)
          block.call(prefetched_element)
        end

        private

        attr_reader :prefetched_element
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
page_magic-2.0.13 lib/page_magic/element/query/prefetched_result.rb
page_magic-2.0.12 lib/page_magic/element/query/prefetched_result.rb
page_magic-2.0.11 lib/page_magic/element/query/prefetched_result.rb
page_magic-2.0.10 lib/page_magic/element/query/prefetched_result.rb
page_magic-2.0.9 lib/page_magic/element/query/prefetched_result.rb
page_magic-2.0.6 lib/page_magic/element/query/prefetched_result.rb
page_magic-2.0.5 lib/page_magic/element/query/prefetched_result.rb
page_magic-2.0.4 lib/page_magic/element/query/prefetched_result.rb
page_magic-2.0.3 lib/page_magic/element/query/prefetched_result.rb
page_magic-2.0.2 lib/page_magic/element/query/prefetched_result.rb
page_magic-2.0.1 lib/page_magic/element/query/prefetched_result.rb
page_magic-2.0.0 lib/page_magic/element/query/prefetched_result.rb