Class: Selenium::WebDriver::Support::Guards::GuardCondition Private
- Inherits:
-
Object
- Object
- Selenium::WebDriver::Support::Guards::GuardCondition
- Defined in:
- rb/lib/selenium/webdriver/support/guards/guard_condition.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Guard derived from RSpec example metadata.
Instance Attribute Summary collapse
- #execution ⇒ Object private
- #name ⇒ Object private
Instance Method Summary collapse
-
#initialize(name, condition = nil, &blk) ⇒ GuardCondition
constructor
private
A new instance of GuardCondition.
- #satisfied?(guard) ⇒ Boolean private
Constructor Details
#initialize(name, condition = nil, &blk) ⇒ GuardCondition
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 GuardCondition.
32 33 34 35 36 37 38 39 |
# File 'rb/lib/selenium/webdriver/support/guards/guard_condition.rb', line 32 def initialize(name, condition = nil, &blk) @name = name @execution = if blk proc(&blk) else proc { |guarded| guarded.include?(condition) } end end |
Instance Attribute Details
#execution ⇒ Object
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.
30 31 32 |
# File 'rb/lib/selenium/webdriver/support/guards/guard_condition.rb', line 30 def execution @execution end |
#name ⇒ Object
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.
30 31 32 |
# File 'rb/lib/selenium/webdriver/support/guards/guard_condition.rb', line 30 def name @name end |
Instance Method Details
#satisfied?(guard) ⇒ Boolean
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.
41 42 43 44 45 |
# File 'rb/lib/selenium/webdriver/support/guards/guard_condition.rb', line 41 def satisfied?(guard) list = Array(guard.guarded[@name]) list.empty? || @execution.call(list) end |