Class: Webstract::Screenshot
- Inherits:
-
Object
- Object
- Webstract::Screenshot
- Defined in:
- lib/webstract/screenshot.rb
Instance Attribute Summary collapse
-
#accept_language ⇒ Object
Returns the value of attribute accept_language.
-
#handle ⇒ Object
readonly
Returns the value of attribute handle.
-
#height ⇒ Object
Returns the value of attribute height.
-
#path ⇒ Object
Returns the value of attribute path.
-
#url ⇒ Object
Returns the value of attribute url.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
- #capture ⇒ Object
-
#initialize(options = {}) ⇒ Screenshot
constructor
A new instance of Screenshot.
Constructor Details
#initialize(options = {}) ⇒ Screenshot
Returns a new instance of Screenshot.
6 7 8 9 10 11 12 13 |
# File 'lib/webstract/screenshot.rb', line 6 def initialize( = {}) @handle = Webstract::ScreenCapture.new() .each do |k, value| setter = "#{k}=" self.public_send(setter, value) if self.respond_to?(setter) end end |
Instance Attribute Details
#accept_language ⇒ Object
Returns the value of attribute accept_language.
3 4 5 |
# File 'lib/webstract/screenshot.rb', line 3 def accept_language @accept_language end |
#handle ⇒ Object (readonly)
Returns the value of attribute handle.
4 5 6 |
# File 'lib/webstract/screenshot.rb', line 4 def handle @handle end |
#height ⇒ Object
Returns the value of attribute height.
3 4 5 |
# File 'lib/webstract/screenshot.rb', line 3 def height @height end |
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/webstract/screenshot.rb', line 3 def path @path end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/webstract/screenshot.rb', line 3 def url @url end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
3 4 5 |
# File 'lib/webstract/screenshot.rb', line 3 def user_agent @user_agent end |
#width ⇒ Object
Returns the value of attribute width.
3 4 5 |
# File 'lib/webstract/screenshot.rb', line 3 def width @width end |
Instance Method Details
#capture ⇒ Object
15 16 17 |
# File 'lib/webstract/screenshot.rb', line 15 def capture handle.capture(url, path, width: width, height: height, user_agent: user_agent, accept_language: accept_language) end |