Class: Monet::Capture
- Inherits:
-
Object
- Object
- Monet::Capture
- Includes:
- Capybara::DSL
- Defined in:
- lib/monet/capture.rb
Constant Summary collapse
- MAX_HEIGHT =
10000
Instance Method Summary collapse
- #capture(url, image_or_save_path) ⇒ Object
- #capture_all ⇒ Object
-
#initialize(config) ⇒ Capture
constructor
A new instance of Capture.
Constructor Details
Instance Method Details
#capture(url, image_or_save_path) ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/monet/capture.rb', line 39 def capture(url, image_or_save_path) if image_or_save_path.is_a? String image = Monet::Image.new image_or_save_path else image = image_or_save_path end visit_once url page.driver.resize(image.width, MAX_HEIGHT) page.driver.render(image.path, full: true) image.thumbnail!(@router.thumbnail_dir) if @config.thumbnail? end |