lib/mechanize/form.rb in mechanize-0.4.6 vs lib/mechanize/form.rb in mechanize-0.4.7

- old
+ new

@@ -192,7 +192,12 @@ def initialize(node) @node = node super(@node, @node) end + + # Fetch the first field whose name is equal to field_name + def field(field_name) + fields.find { |f| f.name.eql? field_name } + end end end