Class: Playwright::InputFiles

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

Instance Method Summary collapse

Constructor Details

#initialize(context, files) ⇒ InputFiles

Returns a new instance of InputFiles.



5
6
7
8
9
10
11
12
13
14
# File 'lib/playwright/input_files.rb', line 5

def initialize(context, files)
  @context = context
  if files.is_a?(File)
    @files = [files]
  elsif files.is_a?(Enumerable)
    @files = files
  else
    @files = [files]
  end
end

Instance Method Details

#as_method_and_paramsObject



16
17
18
19
20
21
22
# File 'lib/playwright/input_files.rb', line 16

def as_method_and_params
  if has_large_file?
    ['setInputFilePaths', params_for_set_input_file_paths]
  else
    ['setInputFiles', params_for_set_input_files]
  end
end