Class: Browserly::Screenshot

Inherits:
Object
  • Object
show all
Extended by:
Comandor
Defined in:
lib/browserly/screenshot.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, height_selector = '') ⇒ Screenshot

Returns a new instance of Screenshot.



8
9
10
11
# File 'lib/browserly/screenshot.rb', line 8

def initialize(url, height_selector = '')
  @url = url
  @height_selector = height_selector
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



6
7
8
# File 'lib/browserly/screenshot.rb', line 6

def file
  @file
end

Instance Method Details

#driverObject



17
18
19
# File 'lib/browserly/screenshot.rb', line 17

def driver
  @driver ||= Browserly::Driver.new(Browserly.configuration.remote_driver, Browserly.configuration.chrome_args).driver
end

#performObject



13
14
15
# File 'lib/browserly/screenshot.rb', line 13

def perform
  take! && close_session!
end