Class: Wreq::Platform

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

Overview

Operating system platform enumeration backed by Rust.

Variants are exposed as constants under this class. Each constant is an instance of Platform and can be passed to Emulation.new via the platform: keyword.

Examples:

Using a predefined platform

platform = Wreq::Platform::Windows
platform.class #=> Wreq::Platform

Applying a platform to emulation

emu = Wreq::Emulation.new(platform: Wreq::Platform::Windows)

Constant Summary collapse

Windows =
nil
MacOS =
nil
Linux =
nil
Android =
nil
IOS =
nil

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Boolean

Value-based equality.

Parameters:

  • other (Object)

Returns:

  • (Boolean)


237
238
# File 'lib/wreq_ruby/emulate.rb', line 237

def ==(other)
end

#eql?(other) ⇒ Boolean

Strict equality for Hash key and Set member semantics.

Parameters:

  • other (Object)

Returns:

  • (Boolean)


245
246
# File 'lib/wreq_ruby/emulate.rb', line 245

def eql?(other)
end

#hashInteger

Hash value consistent with #eql? for use as Hash keys.

Returns:

  • (Integer)


252
253
# File 'lib/wreq_ruby/emulate.rb', line 252

def hash
end

#to_sString

Returns the platform name.

Returns:

  • (String)

    Platform name as a string



222
223
# File 'lib/wreq_ruby/emulate.rb', line 222

def to_s
end

#to_symSymbol

Returns the platform as a lowercase symbol (e.g. :windows, :linux).

Returns:

  • (Symbol)


229
230
# File 'lib/wreq_ruby/emulate.rb', line 229

def to_sym
end