Class: Playwright::Download

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(page:, url:, suggested_filename:, artifact:) ⇒ Download

Returns a new instance of Download.



3
4
5
6
7
8
# File 'lib/playwright/download.rb', line 3

def initialize(page:, url:, suggested_filename:, artifact:)
  @page = page
  @url = url
  @suggested_filename = suggested_filename
  @artifact = artifact
end

Instance Attribute Details

#pageObject (readonly)

Returns the value of attribute page.



10
11
12
# File 'lib/playwright/download.rb', line 10

def page
  @page
end

#suggested_filenameObject (readonly)

Returns the value of attribute suggested_filename.



10
11
12
# File 'lib/playwright/download.rb', line 10

def suggested_filename
  @suggested_filename
end

#urlObject (readonly)

Returns the value of attribute url.



10
11
12
# File 'lib/playwright/download.rb', line 10

def url
  @url
end

Instance Method Details

#deleteObject



12
13
14
# File 'lib/playwright/download.rb', line 12

def delete
  @artifact.delete
end

#failureObject



16
17
18
# File 'lib/playwright/download.rb', line 16

def failure
  @artifact.failure
end

#pathObject



20
21
22
# File 'lib/playwright/download.rb', line 20

def path
  @artifact.path_after_finished
end

#save_as(path) ⇒ Object



24
25
26
# File 'lib/playwright/download.rb', line 24

def save_as(path)
  @artifact.save_as(path)
end