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
15
# File 'lib/playwright/input_files.rb', line 5

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

Instance Method Details

#as_method_and_paramsObject



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

def as_method_and_params
  if @local_directory || has_large_file?
    ['setInputFiles', params_for_set_input_file_paths]
  else
    ['setInputFiles', params_for_set_input_files]
  end
end