class PageMagic::Element::Query::PrefetchedResult

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

Attributes

prefetched_element[R]

Public Class Methods

new(prefetched_element) click to toggle source
Calls superclass method PageMagic::Element::Query::new
# File lib/page_magic/element/query/prefetched_result.rb, line 8
def initialize(prefetched_element)
  super
  @prefetched_element = prefetched_element
end

Public Instance Methods

find(_capybara_element, &block) click to toggle source

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`

# File lib/page_magic/element/query/prefetched_result.rb, line 16
def find(_capybara_element, &block)
  block.call(prefetched_element)
end