Class: Snapcrawl::Screenshot
- Inherits:
-
Object
- Object
- Snapcrawl::Screenshot
- Defined in:
- lib/snapcrawl/screenshot.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url) ⇒ Screenshot
constructor
A new instance of Screenshot.
- #save(outfile = nil) ⇒ Object
Constructor Details
#initialize(url) ⇒ Screenshot
Returns a new instance of Screenshot.
9 10 11 |
# File 'lib/snapcrawl/screenshot.rb', line 9 def initialize(url) @url = url end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
7 8 9 |
# File 'lib/snapcrawl/screenshot.rb', line 7 def url @url end |
Instance Method Details
#save(outfile = nil) ⇒ Object
13 14 15 16 |
# File 'lib/snapcrawl/screenshot.rb', line 13 def save(outfile = nil) outfile ||= "#{url.to_slug}.png" webshot_capture url, outfile end |