Class: Relevance::Tarantula::Form
- Extended by:
- Forwardable
- Defined in:
- lib/relevance/tarantula/form.rb
Instance Attribute Summary collapse
-
#crawler ⇒ Object
Returns the value of attribute crawler.
-
#referrer ⇒ Object
Returns the value of attribute referrer.
Instance Method Summary collapse
- #action ⇒ Object
-
#initialize(tag, crawler, referrer) ⇒ Form
constructor
A new instance of Form.
- #method ⇒ Object
- #rails_method_hack ⇒ Object
Constructor Details
#initialize(tag, crawler, referrer) ⇒ Form
Returns a new instance of Form.
7 8 9 |
# File 'lib/relevance/tarantula/form.rb', line 7 def initialize(tag, crawler, referrer) @tag, @crawler, @referrer = tag, crawler, referrer end |
Instance Attribute Details
#crawler ⇒ Object
Returns the value of attribute crawler.
5 6 7 |
# File 'lib/relevance/tarantula/form.rb', line 5 def crawler @crawler end |
#referrer ⇒ Object
Returns the value of attribute referrer.
5 6 7 |
# File 'lib/relevance/tarantula/form.rb', line 5 def referrer @referrer end |
Instance Method Details
#action ⇒ Object
11 12 13 |
# File 'lib/relevance/tarantula/form.rb', line 11 def action @tag['action'].downcase end |
#method ⇒ Object
15 16 17 |
# File 'lib/relevance/tarantula/form.rb', line 15 def method (rails_method_hack or @tag['method'] or 'get').downcase end |
#rails_method_hack ⇒ Object
19 20 21 |
# File 'lib/relevance/tarantula/form.rb', line 19 def rails_method_hack (tag = @tag.at('input[@name="_method"]')) && tag["value"] end |