class Gauge::GaugeScreenshot
Public Class Methods
instance()
click to toggle source
# File lib/gauge_screenshot.rb, line 19 def self.instance @gauge_screenshots ||= GaugeScreenshot.new end
new()
click to toggle source
# File lib/gauge_screenshot.rb, line 15 def initialize @screenshots = [] end
Public Instance Methods
capture()
click to toggle source
# File lib/gauge_screenshot.rb, line 23 def capture @screenshots.push(capture_to_file) end
capture_to_file()
click to toggle source
# File lib/gauge_screenshot.rb, line 27 def capture_to_file unless Configuration.instance.screenshot_writer? content = Configuration.instance.screengrabber.call file_name = Util.unique_screenshot_file File.write(file_name, content) return File.basename(file_name) end Configuration.instance.screengrabber.call end
clear()
click to toggle source
# File lib/gauge_screenshot.rb, line 47 def clear @screenshots = [] end
get()
click to toggle source
# File lib/gauge_screenshot.rb, line 43 def get @screenshots end
pending_screenshot()
click to toggle source
# File lib/gauge_screenshot.rb, line 37 def pending_screenshot pending_screenshot = @screenshots clear pending_screenshot end