Class: Watir::BaseDecorator
- Inherits:
-
Object
- Object
- Watir::BaseDecorator
- Defined in:
- lib/watir-webdriver/wait.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(element, timeout, message = nil) ⇒ BaseDecorator
constructor
A new instance of BaseDecorator.
- #method_missing(m, *args, &block) ⇒ Object
- #respond_to?(*args) ⇒ Boolean
Constructor Details
#initialize(element, timeout, message = nil) ⇒ BaseDecorator
Returns a new instance of BaseDecorator.
99 100 101 102 103 |
# File 'lib/watir-webdriver/wait.rb', line 99 def initialize(element, timeout, = nil) @element = element @timeout = timeout @message = end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object
109 110 111 112 113 114 115 116 117 |
# File 'lib/watir-webdriver/wait.rb', line 109 def method_missing(m, *args, &block) unless @element.respond_to?(m) raise NoMethodError, "undefined method `#{m}' for #{@element.inspect}:#{@element.class}" end Watir::Wait.until(@timeout, @message) { wait_until } @element.__send__(m, *args, &block) end |
Instance Method Details
#respond_to?(*args) ⇒ Boolean
105 106 107 |
# File 'lib/watir-webdriver/wait.rb', line 105 def respond_to?(*args) @element.respond_to?(*args) end |