Class: StatusCat::Checkers::GoogleCivic
- Defined in:
- lib/status_cat/checkers/google_civic.rb
Constant Summary
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize ⇒ GoogleCivic
constructor
A new instance of GoogleCivic.
- #url ⇒ Object
Methods inherited from Base
Constructor Details
#initialize ⇒ GoogleCivic
Returns a new instance of GoogleCivic.
7 8 9 10 11 12 13 |
# File 'lib/status_cat/checkers/google_civic.rb', line 7 def initialize @value = api_key @status = fail_on_exception do response = ::HTTParty.get(url) response.code == 200 ? nil : 'fail' end end |
Instance Method Details
#url ⇒ Object
15 16 17 |
# File 'lib/status_cat/checkers/google_civic.rb', line 15 def url return "https://www.googleapis.com/civicinfo/v2/representatives?key=#{api_key}&address=94306" end |