Sha256: 7e14ea898078564373b1a754d84d667c5e2f178e3360a50c823a86a2b350c75e

Contents?: true

Size: 435 Bytes

Versions: 4

Compression:

Stored size: 435 Bytes

Contents

module StatusCat
  module Checkers
    class GoogleCivic < Base

      cattr_accessor :api_key

      def initialize
        @value = api_key
        @status = fail_on_exception do
          response = ::HTTParty.get(url)
          response.code == 200 ? nil : 'fail'
        end
      end

      def url
        return "https://www.googleapis.com/civicinfo/v2/representatives?key=#{api_key}&address=94306"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
status_cat-5.2.1 lib/status_cat/checkers/google_civic.rb
status_cat-5.2.0 lib/status_cat/checkers/google_civic.rb
status_cat-5.0.2 lib/status_cat/checkers/google_civic.rb
status_cat-5.0.1 lib/status_cat/checkers/google_civic.rb