Method: Selenium::WebDriver::Support::Guards::Guard#initialize

Defined in:
lib/selenium/webdriver/support/guards/guard.rb

#initialize(guarded, type, guards = nil) ⇒ Guard

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Guard.



32
33
34
35
36
37
38
39
40
41
# File 'lib/selenium/webdriver/support/guards/guard.rb', line 32

def initialize(guarded, type, guards = nil)
  @guarded = guarded
  @tracker = guards&.bug_tracker || ''
  @messages = guards&.messages || {}
  @messages[:unknown] = 'TODO: Investigate why this is failing and file a bug report'
  @type = type

  @reason = @guarded[:reason] || 'No reason given'
  @guarded[:reason] = @reason
end