Class: Crawlberg::PageActionScroll

Inherits:
Data
  • Object
show all
Extended by:
T::Sig
Includes:
PageAction
Defined in:
lib/crawlberg/native.rb

Overview

Scroll the page or a specific element.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#amountObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



326
327
328
# File 'lib/crawlberg/native.rb', line 326

def amount
  @amount
end

#directionObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



326
327
328
# File 'lib/crawlberg/native.rb', line 326

def direction
  @direction
end

#selectorObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



326
327
328
# File 'lib/crawlberg/native.rb', line 326

def selector
  @selector
end

Class Method Details

.from_hash(hash) ⇒ Object



358
359
360
361
362
363
364
# File 'lib/crawlberg/native.rb', line 358

def self.from_hash(hash)
  new(
    direction: hash[:direction] || hash["direction"],
    selector: hash[:selector] || hash["selector"],
    amount: hash[:amount] || hash["amount"]
  )
end

Instance Method Details

#click?Boolean

Returns:

  • (Boolean)


340
# File 'lib/crawlberg/native.rb', line 340

def click? = false

#execute_js?Boolean

Returns:

  • (Boolean)


352
# File 'lib/crawlberg/native.rb', line 352

def execute_js? = false

#press?Boolean

Returns:

  • (Boolean)


344
# File 'lib/crawlberg/native.rb', line 344

def press? = false

#scrape?Boolean

Returns:

  • (Boolean)


354
355
356
# File 'lib/crawlberg/native.rb', line 354

def scrape? = false
# @param hash [Hash] deserialized from the native extension
# @return [self]

#screenshot?Boolean

Returns:

  • (Boolean)


350
# File 'lib/crawlberg/native.rb', line 350

def screenshot? = false

#scroll?Boolean

Returns:

  • (Boolean)


346
# File 'lib/crawlberg/native.rb', line 346

def scroll? = true

#type_text?Boolean

Returns:

  • (Boolean)


342
# File 'lib/crawlberg/native.rb', line 342

def type_text? = false

#wait?Boolean

Returns:

  • (Boolean)


348
# File 'lib/crawlberg/native.rb', line 348

def wait? = false