Sha256: 2a0f57e7913600be5dde712117fa73fb9ecbd851893cb9dbd1af9203b39b3563

Contents?: true

Size: 548 Bytes

Versions: 6

Compression:

Stored size: 548 Bytes

Contents

module Relevance
  module Tarantula

    class Form
      extend Forwardable
      def_delegators("@tag", :search)

      attr_accessor :crawler, :referrer

      def initialize(tag, crawler, referrer)
        @tag, @crawler, @referrer = tag, crawler, referrer
      end

      def action
        @tag['action'].downcase
      end

      def method
        (rails_method_hack or @tag['method'] or 'get').downcase
      end

      def rails_method_hack
        (tag = @tag.at('input[@name="_method"]')) && tag["value"]
      end

    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tarantula-0.5.1 lib/relevance/tarantula/form.rb
tarantula-0.5.0 lib/relevance/tarantula/form.rb
tarantula-0.4.3 lib/relevance/tarantula/form.rb
tarantula-0.4.2 lib/relevance/tarantula/form.rb
tarantula-0.4.1 lib/relevance/tarantula/form.rb
tarantula-0.4.0 lib/relevance/tarantula/form.rb