Class: Wreq::Emulation

Inherits:
Object
  • Object
show all
Defined in:
lib/wreq_ruby/emulation.rb

Overview

Emulation option wrapper.

This class wraps device and OS emulation options and provides a unified interface for browser environment simulation. The actual implementation is provided by Rust for performance.

Examples:

Create an emulation option

emu = Wreq::Emulation.new(device: Wreq::EmulationDevice::Chrome117, os: Wreq::EmulationOS::Windows)

Class Method Summary collapse

Class Method Details

.new(device: nil, os: nil, skip_http2: false, skip_headers: false) ⇒ Object

Parameters:

  • device (Wreq::EmulationDevice) (defaults to: nil)

    Device profile (optional)

  • os (Wreq::EmulationOS) (defaults to: nil)

    Operating system profile (optional)

  • skip_http2 (Boolean) (defaults to: false)

    Whether to skip HTTP/2 (optional)

  • skip_headers (Boolean) (defaults to: false)

    Whether to skip default headers (optional)



199
200
# File 'lib/wreq_ruby/emulation.rb', line 199

def self.new(device: nil, os: nil, skip_http2: false, skip_headers: false)
end