Class: Scrapetor::Native::DocumentWrapper::LazyIds

Inherits:
Struct
  • Object
show all
Defined in:
lib/scrapetor/native_dom.rb

Overview

‘lazy_css` is the fast path that Document#css uses: it returns raw ids when the native engine can handle the whole selector, so the Element-wrap happens once-per-iteration instead of once-per-result. Falls back to the eager `css` when native can’t handle the selector (kind, fallback dom, etc.).

Returns a ‘LazyIds` struct OR an Array of strings (for ::text/::attr) OR an Array of Element wrappers (when the selector needs the Dom fallback).

Instance Attribute Summary collapse

Instance Attribute Details

#idsObject

Returns the value of attribute ids

Returns:

  • (Object)

    the current value of ids



1011
1012
1013
# File 'lib/scrapetor/native_dom.rb', line 1011

def ids
  @ids
end

#nativeObject

Returns the value of attribute native

Returns:

  • (Object)

    the current value of native



1011
1012
1013
# File 'lib/scrapetor/native_dom.rb', line 1011

def native
  @native
end

#wrapperObject

Returns the value of attribute wrapper

Returns:

  • (Object)

    the current value of wrapper



1011
1012
1013
# File 'lib/scrapetor/native_dom.rb', line 1011

def wrapper
  @wrapper
end