Class: Horseman::Dom::Form
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#encoding ⇒ Object
Returns the value of attribute encoding.
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#submit ⇒ Object
Returns the value of attribute submit.
Attributes inherited from Element
Instance Method Summary collapse
- #method_missing(method, *arguments, &block) ⇒ Object
- #respond_to?(method_sym, include_private = false) ⇒ Boolean
Methods inherited from Element
Constructor Details
This class inherits a constructor from Horseman::Dom::Element
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *arguments, &block) ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/horseman/dom/form.rb', line 12 def method_missing(method, *arguments, &block) case method when :[] indexer = arguments[0] field = @fields.select {|name, field| name.to_s == indexer}.map {|k,v| v}.first return field unless field.nil? end puts "Not implemented in Form: #{method} #{arguments.join(',')}" end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
6 7 8 |
# File 'lib/horseman/dom/form.rb', line 6 def action @action end |
#encoding ⇒ Object
Returns the value of attribute encoding.
6 7 8 |
# File 'lib/horseman/dom/form.rb', line 6 def encoding @encoding end |
#fields ⇒ Object
Returns the value of attribute fields.
6 7 8 |
# File 'lib/horseman/dom/form.rb', line 6 def fields @fields end |
#submit ⇒ Object
Returns the value of attribute submit.
6 7 8 |
# File 'lib/horseman/dom/form.rb', line 6 def submit @submit end |
Instance Method Details
#respond_to?(method_sym, include_private = false) ⇒ Boolean
8 9 10 |
# File 'lib/horseman/dom/form.rb', line 8 def respond_to?(method_sym, include_private = false) true end |