Class: PageMagic::Element::Query::PrefetchedResult

Inherits:
PageMagic::Element::Query show all
Defined in:
lib/page_magic/element/query/prefetched_result.rb

Overview

class PrefetchedResult - used to return element that has already been retrieved

Constant Summary

Constants inherited from PageMagic::Element::Query

DEFAULT_DECORATOR

Instance Attribute Summary

Attributes inherited from PageMagic::Element::Query

#options, #selector_args

Instance Method Summary collapse

Methods inherited from PageMagic::Element::Query

#==, #execute

Constructor Details

#initialize(prefetched_element) ⇒ PrefetchedResult

Returns a new instance of PrefetchedResult.



8
9
10
11
# File 'lib/page_magic/element/query/prefetched_result.rb', line 8

def initialize(prefetched_element)
  super
  @prefetched_element = prefetched_element
end

Instance Method Details

#find(_capybara_element, &block) ⇒ Capybara::Node::Element

Returns the object provided to initialize The supplied block will be used to decorate the results

Returns:

  • (Capybara::Node::Element)

    the object supplied to initialize



16
17
18
# File 'lib/page_magic/element/query/prefetched_result.rb', line 16

def find(_capybara_element, &block)
  block.call(prefetched_element)
end