Class: TestHarness::FormStruct
- Inherits:
-
Object
- Object
- TestHarness::FormStruct
- Defined in:
- lib/form_struct.rb
Instance Attribute Summary collapse
-
#browser ⇒ Object
Returns the value of attribute browser.
Instance Method Summary collapse
-
#initialize(browser) ⇒ FormStruct
constructor
A new instance of FormStruct.
- #method_missing(name, *args, &block) ⇒ Object
Constructor Details
#initialize(browser) ⇒ FormStruct
Returns a new instance of FormStruct.
5 6 7 |
# File 'lib/form_struct.rb', line 5 def initialize(browser) self.browser = browser end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/form_struct.rb', line 9 def method_missing(name, *args, &block) id = name.to_s.chomp('=') value = args[0] field = browser.find_field(id) field[:type] =~ /^select/ ? field.select(value) : field.set(value) end |
Instance Attribute Details
#browser ⇒ Object
Returns the value of attribute browser.
3 4 5 |
# File 'lib/form_struct.rb', line 3 def browser @browser end |