Class: Applitools::UniversalEyesManagerConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/applitools/universal_sdk/universal_eyes_manager_config.rb

Constant Summary collapse

VG =
'ufg'.freeze
CLASSIC =
'classic'.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ UniversalEyesManagerConfig

Returns a new instance of UniversalEyesManagerConfig.



27
28
29
30
31
32
33
# File 'lib/applitools/universal_sdk/universal_eyes_manager_config.rb', line 27

def initialize(*args)
  options = Applitools::Utils.extract_options!(args)
  self.type = options[:type].to_s
  self.concurrency = options[:concurrency]
  self.legacy = options[:legacy]
  @runner_agent_id = options[:runner_agent_id]
end

Instance Attribute Details

#concurrencyObject

export type EyesManagerConfig<TType extends ‘vg’ | ‘classic’ = ‘vg’ | ‘classic’> =

type: TType
concurrency?: TType extends 'vg' ? number : never
legacy?: TType extends 'vg' ? boolean : never



19
20
21
# File 'lib/applitools/universal_sdk/universal_eyes_manager_config.rb', line 19

def concurrency
  @concurrency
end

#legacyObject

export type EyesManagerConfig<TType extends ‘vg’ | ‘classic’ = ‘vg’ | ‘classic’> =

type: TType
concurrency?: TType extends 'vg' ? number : never
legacy?: TType extends 'vg' ? boolean : never



19
20
21
# File 'lib/applitools/universal_sdk/universal_eyes_manager_config.rb', line 19

def legacy
  @legacy
end

#runner_agent_idObject (readonly)

export type EyesManagerConfig<TType extends ‘vg’ | ‘classic’ = ‘vg’ | ‘classic’> =

type: TType
concurrency?: TType extends 'vg' ? number : never
legacy?: TType extends 'vg' ? boolean : never



19
20
21
# File 'lib/applitools/universal_sdk/universal_eyes_manager_config.rb', line 19

def runner_agent_id
  @runner_agent_id
end

#typeObject

export type EyesManagerConfig<TType extends ‘vg’ | ‘classic’ = ‘vg’ | ‘classic’> =

type: TType
concurrency?: TType extends 'vg' ? number : never
legacy?: TType extends 'vg' ? boolean : never



19
20
21
# File 'lib/applitools/universal_sdk/universal_eyes_manager_config.rb', line 19

def type
  @type
end

Class Method Details

.classicObject



6
7
8
# File 'lib/applitools/universal_sdk/universal_eyes_manager_config.rb', line 6

def self.classic
  new(type: CLASSIC, runner_agent_id: "eyes.classic.ruby/#{Applitools::VERSION}")
end

.vg(concurrent_open_sessions = 1) ⇒ Object



10
11
12
# File 'lib/applitools/universal_sdk/universal_eyes_manager_config.rb', line 10

def self.vg(concurrent_open_sessions=1)
  new(type: VG, concurrency: concurrent_open_sessions, legacy: false, runner_agent_id: "eyes.visualgrid.ruby/#{Applitools::VERSION}")
end

Instance Method Details

#to_hashObject



53
54
55
56
57
58
59
60
61
# File 'lib/applitools/universal_sdk/universal_eyes_manager_config.rb', line 53

def to_hash
  result = {}
  result[:type] = type
  result[:settings] = {}
  result[:settings][:concurrency] = concurrency if concurrency
  result[:settings][:legacyConcurrency] = legacy if legacy
  result[:settings][:agentId] = runner_agent_id
  result.compact
end

#type_enum_valuesObject



23
24
25
# File 'lib/applitools/universal_sdk/universal_eyes_manager_config.rb', line 23

def type_enum_values
  [VG, CLASSIC]
end