Module: Vapir::WatirConfigCompatibility::WatirBrowserClassConfigCompatibility
- Defined in:
- lib/vapir-common/browser.rb
Constant Summary collapse
- OptionsKeys =
[:speed, :attach_timeout, :visible]
Instance Method Summary collapse
- #attach_timeout ⇒ Object
- #attach_timeout=(timeout) ⇒ Object
- #options ⇒ Object
- #set_options(options) ⇒ Object
Instance Method Details
#attach_timeout ⇒ Object
170 171 172 173 174 175 176 177 178 |
# File 'lib/vapir-common/browser.rb', line 170 def attach_timeout if self==Vapir::Browser return browser_class.attach_timeout end if config.warn_deprecated Kernel.warn_with_caller "WARNING: #attach_timeout is deprecated; please use the new config framework with config.attach_timeout" end config.attach_timeout end |
#attach_timeout=(timeout) ⇒ Object
179 180 181 182 183 184 185 186 187 |
# File 'lib/vapir-common/browser.rb', line 179 def attach_timeout=(timeout) if self==Vapir::Browser return browser_class.attach_timeout=timeout end if config.warn_deprecated Kernel.warn_with_caller "WARNING: #attach_timeout= is deprecated; please use the new config framework with config.attach_timeout=" end config.attach_timeout = timeout end |
#options ⇒ Object
144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/vapir-common/browser.rb', line 144 def if self==Vapir::Browser return browser_class. end if config.warn_deprecated Kernel.warn_with_caller "WARNING: #options is deprecated; please use the new config framework" end OptionsKeys.inject({}) do |hash, key| respond_to?(key) ? hash.merge(key => self.send(key)) : hash end.freeze end |
#set_options(options) ⇒ Object
155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/vapir-common/browser.rb', line 155 def () if self==Vapir::Browser return browser_class.() end if config.warn_deprecated Kernel.warn_with_caller "WARNING: #set_options is deprecated; please use the new config framework" end unless ( = .keys - OptionsKeys.select{|key| respond_to?("#{key}=")}).empty? raise ArgumentError, "unknown options: #{.inspect}" end .each do |key, value| self.send("#{key}=", value) end end |