census_api 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62d635eb4a50f1607cf754133ec5e2df2458f774
4
- data.tar.gz: db81cacdbddc88f77a4202b59329b6ff7e2929b0
3
+ metadata.gz: d1e42362ccc80926634c273b9a7a1eb5372226b0
4
+ data.tar.gz: 82964eda9cfe6f7d764f96575882c57e41133e2f
5
5
  SHA512:
6
- metadata.gz: 21714d668b24434213474a8a2647f7a5350a1cf65bcc227c4c402e789ce9c2f5adacbc5141b748575a0564a5faf5a5c1fd21923bb6f24118caa6656c3af45047
7
- data.tar.gz: 715488e993f03ccde604f610840c234cd70e6dfdda0c75c05b48b8f011482f16d37bb3e51fcf7d29e9bd2f63e7894c535eba08d0bc100f61d173b7dcc4ca4d7c
6
+ metadata.gz: 982d9a504da1de9f2254dc0eb2116e647228a6c1447564fb3e9c101b0e601a0bdf6dbcebf9bd8efac888a0b3ea60fc08a7c020bbd70835e3336cc4f2b6529935
7
+ data.tar.gz: 7493ed0eb2d8a301ed7032321c15d0833600e6325425dfc8e8c392b7eefdcf5899cf3e3874438c595b0d49b4156367dc960a49589143fe2313ed218da1a79b75
@@ -19,6 +19,7 @@ module CensusApi
19
19
  end
20
20
 
21
21
  @api_key = api_key
22
+ @api_vintage = options[:vintage] || 2010
22
23
  if options[:dataset]
23
24
  @dataset = options[:dataset].downcase if DATASETS.include? options[:dataset].downcase
24
25
  end
@@ -26,7 +27,7 @@ module CensusApi
26
27
 
27
28
  def find(fields, level, *within)
28
29
  raise "Client has not been assigned a dataset to query. Try @client.dataset = 'SF1' or anything from #{DATASETS}" if self.dataset.nil?
29
- Request.find(dataset, {key: @api_key, fields: fields, level: level, within: within})
30
+ Request.find(dataset, {key: @api_key, vintage: @api_vintage, fields: fields, level: level, within: within})
30
31
  end
31
32
  end
32
33
  end
@@ -1,3 +1,3 @@
1
1
  module CensusApi
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  end
@@ -28,14 +28,14 @@ describe CensusApi::Client do
28
28
  end
29
29
 
30
30
  it 'should request sf1' do
31
- source, options = 'sf1', {:key=> api_key, :fields => 'P0010001', :level => 'STATE:06', :within=>[]}
31
+ source, options = 'sf1', {:key=> api_key, :vintage => 2010, :fields => 'P0010001', :level => 'STATE:06', :within=>[]}
32
32
  @client = CensusApi::Client.new(api_key, dataset: source)
33
33
  CensusApi::Request.should_receive(:find).with(@client.dataset, options)
34
34
  @client.find(options[:fields], options[:level])
35
35
  end
36
36
 
37
37
  it 'should request acs5' do
38
- source, options = 'acs5', {:key=> api_key, :fields => 'B00001_001E', :level => 'STATE:06', :within=>[]}
38
+ source, options = 'acs5', {:key=> api_key, :vintage => 2010, :fields => 'B00001_001E', :level => 'STATE:06', :within=>[]}
39
39
  @client = CensusApi::Client.new(api_key, dataset: source)
40
40
  CensusApi::Request.should_receive(:find).with(@client.dataset, options)
41
41
  @client.find(options[:fields], options[:level])
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: census_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ty Rauber
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-16 00:00:00.000000000 Z
11
+ date: 2014-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client