Class: Capybara::Harness::Dom::Writer
- Inherits:
-
Object
- Object
- Capybara::Harness::Dom::Writer
- Defined in:
- lib/capybara/harness/dom/writer.rb
Instance Attribute Summary collapse
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #field(*args) ⇒ Object
- #fill(attrs = {}) ⇒ Object
-
#initialize ⇒ Writer
constructor
A new instance of Writer.
Constructor Details
#initialize ⇒ Writer
Returns a new instance of Writer.
5 6 7 |
# File 'lib/capybara/harness/dom/writer.rb', line 5 def initialize self.fields = [] end |
Instance Attribute Details
#fields ⇒ Object
Returns the value of attribute fields.
3 4 5 |
# File 'lib/capybara/harness/dom/writer.rb', line 3 def fields @fields end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/capybara/harness/dom/writer.rb', line 3 def name @name end |
Instance Method Details
#field(*args) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/capybara/harness/dom/writer.rb', line 9 def field(*args) = args.last.is_a?(Hash) ? args.pop : {} args.each do |field_name| fields << Capybara::Harness::Dom::Field.new(field_name, ) end end |
#fill(attrs = {}) ⇒ Object
17 18 19 |
# File 'lib/capybara/harness/dom/writer.rb', line 17 def fill(attrs = {}) fields.each { |f| f.fill(attrs) } end |