get-your-rep 1.1.1 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/get-your-rep.rb +8 -1
  3. metadata +18 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 839cadee15c7e85c63f324be9aa8e7c8e9d4645c
4
- data.tar.gz: 5f932732be3da07629fb6332de2d9bd07c50f92c
3
+ metadata.gz: d3e6fb98f32b46c84349c857d8725a6cd77b3ccf
4
+ data.tar.gz: 43e60f9159b33228e804c940af05df840862f22a
5
5
  SHA512:
6
- metadata.gz: 78de803d20f2ffd74eba17b2a8c769e6793893545fa35de5189f762b3839fefce2d689ad38c9901416c6de6f92acd17debf8787827ab00a207e1b745bd525de1
7
- data.tar.gz: e7c46802f372cfecca5faa50ba9b3d58124237ce8f451c7a0375e93efd75c8182ce97aebdade76a305bd13286da3e10500bd2725a38fa586983e68938cc17495
6
+ metadata.gz: 8bbd899a1aa0fe3eddae65fb9f1233bd9e9cb18553c7e27e43d586c6ce86c6c011dc1e88767f4d22f0cf92db29cf43f1a14366c912aa52b61b7ab8f47026043a
7
+ data.tar.gz: c9555f3c68f574d04bd4dde465f3f60d5727a2e6a9028362d578a84f5ae23f7fe644d67d92a9ed80f284949d1914de420c4ac49f4de62938e0e588f39a72421f
data/lib/get-your-rep.rb CHANGED
@@ -9,7 +9,10 @@ require_relative 'get-your-rep/patches.rb'
9
9
  # environment variable using the constant name 'GOOGLE_API_KEY' in order for this gem to work.
10
10
  class GetYourRep
11
11
 
12
- # Call GetYourRep#now to initiate a chain of method calls on self that will instantiate a Delegation object and return it.
12
+ # Call GetYourRep#now to initiate a chain of method calls on self that will instantiate a
13
+ # Delegation object and return it.
14
+ # Supported options for :level are "national"(default) and "state".
15
+ # Supported options for :role are "representative"(default), "senator", "executive" and "vice executive".
13
16
  def self.now(address, level: 'national', role: 'representative')
14
17
  @address = voter_address(address)
15
18
  @api_key = ENV['GOOGLE_API_KEY']
@@ -49,6 +52,10 @@ class GetYourRep
49
52
  'legislatorLowerBody'
50
53
  when 'senator'
51
54
  'legislatorUpperBody'
55
+ when 'executive'
56
+ 'headOfGovernment'
57
+ when 'vice executive'
58
+ 'deputyHeadOfGovernment'
52
59
  end
53
60
  url = "https://www.googleapis.com/civicinfo/v2/representatives?address=#{@address}%20&includeOffices=true&levels=#{level}&roles=#{role}&fields=offices%2Cofficials&key=#{@api_key}"
54
61
  HTTParty.get(url).parsed_response
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: get-your-rep
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - msimonborg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-11 00:00:00.000000000 Z
11
+ date: 2016-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -78,8 +78,23 @@ dependencies:
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
80
  version: 1.1.13
81
+ - !ruby/object:Gem::Dependency
82
+ name: rake
83
+ requirement: !ruby/object:Gem::Requirement
84
+ requirements:
85
+ - - ">="
86
+ - !ruby/object:Gem::Version
87
+ version: '0'
88
+ type: :development
89
+ prerelease: false
90
+ version_requirements: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: '0'
81
95
  description: Get your rep with Google's Civic Information API using your address and
82
- API key.
96
+ API key. Check the documentation and README for new search options added in this
97
+ release.
83
98
  email: msimonborg@gmail.com
84
99
  executables: []
85
100
  extensions: []