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



356
357
358
# File 'lib/crawlberg/native.rb', line 356

def amount
  @amount
end

#directionObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



356
357
358
# File 'lib/crawlberg/native.rb', line 356

def direction
  @direction
end

#selectorObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



356
357
358
# File 'lib/crawlberg/native.rb', line 356

def selector
  @selector
end

Class Method Details

.from_hash(hash) ⇒ Object



391
392
393
394
395
396
397
# File 'lib/crawlberg/native.rb', line 391

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)


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

def click? = false

#execute_js?Boolean

Returns:

  • (Boolean)


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

def execute_js? = false

#press?Boolean

Returns:

  • (Boolean)


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

def press? = false

#scrape?Boolean

Returns:

  • (Boolean)


387
388
389
# File 'lib/crawlberg/native.rb', line 387

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

#screenshot?Boolean

Returns:

  • (Boolean)


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

def screenshot? = false

#scroll?Boolean

Returns:

  • (Boolean)


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

def scroll? = true

#type_text?Boolean

Returns:

  • (Boolean)


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

def type_text? = false

#wait?Boolean

Returns:

  • (Boolean)


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

def wait? = false