Class: GoogleCivic::Client
- Inherits:
-
Object
- Object
- GoogleCivic::Client
- Includes:
- Connection, Request
- Defined in:
- lib/google-civic/client.rb
Instance Method Summary collapse
-
#elections(options = {}) ⇒ Hashie::Mash
Gets a list of elections in the API.
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
-
#representative_info(address, options = {}) ⇒ Hashie::Mash
Looks up political geography and (optionally) representative information based on an address.
-
#voter_info(election_id, address, options = {}) ⇒ Hashie::Mash
Looks up information relevant to a voter based on the voter's registered address.
Methods included from Request
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
6 7 8 |
# File 'lib/google-civic/client.rb', line 6 def initialize(={}) @key = [:key] end |
Instance Method Details
#elections(options = {}) ⇒ Hashie::Mash
Gets a list of elections in the API
19 20 21 |
# File 'lib/google-civic/client.rb', line 19 def elections(={}) get("elections", ) end |
#representative_info(address, options = {}) ⇒ Hashie::Mash
Looks up political geography and (optionally) representative information based on an address
44 45 46 |
# File 'lib/google-civic/client.rb', line 44 def representative_info(address, ={}) post("representatives/lookup", {address: address}, ) end |
#voter_info(election_id, address, options = {}) ⇒ Hashie::Mash
Looks up information relevant to a voter based on the voter's registered address.
32 33 34 |
# File 'lib/google-civic/client.rb', line 32 def voter_info(election_id, address, ={}) post("voterinfo/#{election_id}/lookup", {address: address}, ) end |