Class: Playwright::SelectOptionValues

Inherits:
Object
  • Object
show all
Defined in:
lib/playwright/select_option_values.rb

Instance Method Summary collapse

Constructor Details

#initialize(element: nil, index: nil, value: nil, label: nil) ⇒ SelectOptionValues

Returns a new instance of SelectOptionValues.



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/playwright/select_option_values.rb', line 3

def initialize(element: nil, index: nil, value: nil, label: nil)
  params = {}

  options = []
  if value
    options.concat(convert(:value, value))
  end

  if index
    options.concat(convert(:index, index))
  end

  if label
    options.concat(convert(:label, label))
  end

  unless options.empty?
    params[:options] = options
  end

  if element
    params[:elements] = convert(:element, element)
  end

  @params = params
end

Instance Method Details

#as_paramsHash

Returns:

  • (Hash)


31
32
33
# File 'lib/playwright/select_option_values.rb', line 31

def as_params
  @params
end