Class: Browserly::Screenshot
- Inherits:
-
Object
- Object
- Browserly::Screenshot
- Extended by:
- Comandor
- Defined in:
- lib/browserly/screenshot.rb
Instance Attribute Summary collapse
-
#browser ⇒ Object
readonly
Returns the value of attribute browser.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#pool ⇒ Object
readonly
Returns the value of attribute pool.
-
#selector ⇒ Object
readonly
Returns the value of attribute selector.
Instance Method Summary collapse
-
#initialize(url, selector = '') ⇒ Screenshot
constructor
A new instance of Screenshot.
- #perform ⇒ Object
Constructor Details
#initialize(url, selector = '') ⇒ Screenshot
9 10 11 12 13 14 |
# File 'lib/browserly/screenshot.rb', line 9 def initialize(url, selector = '') @url = url @pool = Browserly::Pool.instance @browser = pool.take_browser @selector = selector end |
Instance Attribute Details
#browser ⇒ Object (readonly)
Returns the value of attribute browser.
7 8 9 |
# File 'lib/browserly/screenshot.rb', line 7 def browser @browser end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
7 8 9 |
# File 'lib/browserly/screenshot.rb', line 7 def file @file end |
#pool ⇒ Object (readonly)
Returns the value of attribute pool.
7 8 9 |
# File 'lib/browserly/screenshot.rb', line 7 def pool @pool end |
#selector ⇒ Object (readonly)
Returns the value of attribute selector.
7 8 9 |
# File 'lib/browserly/screenshot.rb', line 7 def selector @selector end |
Instance Method Details
#perform ⇒ Object
16 17 18 |
# File 'lib/browserly/screenshot.rb', line 16 def perform take_screenshot! && release_browser! end |