Sha256: 578e176cdd1114e01f55d75944325990a3472cdf860143b2ae14e216b8d61f5b

Contents?: true

Size: 649 Bytes

Versions: 2

Compression:

Stored size: 649 Bytes

Contents

module GovKit
  module CA
    module PostalCode
      module Strategy
        class ParlGcCa < Base
          base_uri 'www.parl.gc.ca'
          http_method :get
          path '/ParlInfo/Compilations/HouseOfCommons/MemberByPostalCode.aspx?PostalCode=<%= @postal_code %>'

        private

          def electoral_districts!
            # @todo returns HTML with electoral district names only
          end

          def valid?
            !!div
          end

          def div
            @div ||= Nokogiri::HTML(response.parsed_response, nil, 'utf-8').at_css('#ctl00_cphContent_pnlWithMP')
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
govkit-ca-0.0.12 lib/gov_kit-ca/postal_code/strategy/parl_gc_ca.rb
govkit-ca-0.0.11 lib/gov_kit-ca/postal_code/strategy/parl_gc_ca.rb