Class: Watobo::Parser::HTML::Form

Inherits:
Object
  • Object
show all
Defined in:
lib/watobo/parser/html.rb

Instance Method Summary collapse

Constructor Details

#initialize(form_css) ⇒ Form

Returns a new instance of Form.



36
37
38
39
40
41
42
43
# File 'lib/watobo/parser/html.rb', line 36

def initialize(form_css)
  @form = form_css
  @input_fields = []
  @form.css('input').each do |i|
    @input_fields << InputField.new(i)
  end

end

Instance Method Details

#input_fields(&block) ⇒ Object



27
28
29
30
31
32
33
34
# File 'lib/watobo/parser/html.rb', line 27

def input_fields(&block)
  if block_given?
    @input_fields.each do |field|
      yield field
    end
  end
  @input_fields
end