Class: PageMagic::Element::Query::PrefetchedResult
- Inherits:
-
PageMagic::Element::Query
- Object
- PageMagic::Element::Query
- PageMagic::Element::Query::PrefetchedResult
- 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
Instance Attribute Summary
Attributes inherited from PageMagic::Element::Query
Instance Method Summary collapse
-
#find(_capybara_element, &block) ⇒ Capybara::Node::Element
Returns the object provided to
initialize
The supplied block will be used to decorate the results. -
#initialize(prefetched_element) ⇒ PrefetchedResult
constructor
A new instance of PrefetchedResult.
Methods inherited from PageMagic::Element::Query
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
16 17 18 |
# File 'lib/page_magic/element/query/prefetched_result.rb', line 16 def find(, &block) block.call(prefetched_element) end |