Class: Scrape456::ScreenshotFilenameSequence
- Inherits:
-
Object
- Object
- Scrape456::ScreenshotFilenameSequence
- Defined in:
- lib/scrape456/screenshot_filename_sequence.rb
Overview
Returns filenames for successive screenshots. The resulting filenames sort by date and sequence and include descriptive labels.
Usage example:
shot_filenames = ScreenshotFilenameSequence.new … session.save_screenshot(shot_filenames.next(:after_click_event_attendee_data))
Instance Method Summary collapse
-
#initialize ⇒ ScreenshotFilenameSequence
constructor
A new instance of ScreenshotFilenameSequence.
- #next(label) ⇒ Object
Constructor Details
#initialize ⇒ ScreenshotFilenameSequence
Returns a new instance of ScreenshotFilenameSequence.
13 14 15 |
# File 'lib/scrape456/screenshot_filename_sequence.rb', line 13 def initialize @counter = 0 end |
Instance Method Details
#next(label) ⇒ Object
17 18 19 20 |
# File 'lib/scrape456/screenshot_filename_sequence.rb', line 17 def next(label) @counter += 1 Time.now.utc.iso8601 + '-' + ('%02d' % @counter) + '-' + label.to_s + '.png' end |