Sha256: 61b264f54cb8a39e982159483862de3488a677e5b6bd393bcebf994a02382ddb

Contents?: true

Size: 588 Bytes

Versions: 4

Compression:

Stored size: 588 Bytes

Contents

module GovKit
  module CA
    module PostalCode
      module Strategy
        class GreenPartyCa < Base
          base_uri 'www.greenparty.ca'
          http_method :post
          path '/en/party/find-your-riding'
          post_data 'form_id=riding_lookup_form&postal_code=<%= @postal_code %>'

        private

          def electoral_districts!
            [response.headers['location'][/\d+\z/]]
          end

          def valid?
            response.headers['location'] != 'http://www.greenparty.ca/en/party/find-your-riding'
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
govkit-ca-0.0.16 lib/gov_kit-ca/postal_code/strategy/greenparty_ca.rb
govkit-ca-0.0.15 lib/gov_kit-ca/postal_code/strategy/greenparty_ca.rb
govkit-ca-0.0.14 lib/gov_kit-ca/postal_code/strategy/greenparty_ca.rb
govkit-ca-0.0.13 lib/gov_kit-ca/postal_code/strategy/greenparty_ca.rb