123456789_123456789_123456789_123456789_123456789_

Class: Selenium::WebDriver::Support::Guards::GuardCondition Private

Do not use. This class is for internal use only.
Relationships & Source Files
Inherits: Object
Defined in: rb/lib/selenium/webdriver/support/guards/guard_condition.rb

Overview

Guard derived from RSpec example metadata.

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(name, condition = nil, &blk) ⇒ GuardCondition

[ GitHub ]

  
# 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 (rw)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/support/guards/guard_condition.rb', line 30

attr_accessor :name, :execution

#name (rw)

[ GitHub ]

  
# File 'rb/lib/selenium/webdriver/support/guards/guard_condition.rb', line 30

attr_accessor :name, :execution

Instance Method Details

#satisfied?(guard) ⇒ Boolean

[ GitHub ]

  
# 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