Sha256: bbb1f0e69c131fd6dc23716850025fafb142db27a85c1239f67d0b889680021c

Contents?: true

Size: 600 Bytes

Versions: 1

Compression:

Stored size: 600 Bytes

Contents

module GovKit
  module CA
    module PostalCode
      module Strategy
        class LiberalCa < Base
          base_uri 'www.liberal.ca'

        private

          def electoral_districts!
            Nokogiri::HTML(response.parsed_response).css('img.RidingListImage').map{|img| img[:src][/\d{5}/]}
          end

          def valid?
            !response.parsed_response.match /\bOopsies!/
          end

          def response
            @response ||= self.class.get "/riding/postal/#{@postal_code}/"
          end
        end

        StrategySet.register LiberalCa
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
govkit-ca-0.0.1 lib/gov_kit-ca/postal_code/strategy/liberal-ca.rb