campaign_cash 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -12,6 +12,7 @@ Simple ruby wrapper for The New York Times Campaign Finance API[http://developer
12
12
 
13
13
  == News
14
14
 
15
+ * Jan. 13, 2012: Version 2.0.2 released. Bugfix to set offset=nil as default.
15
16
  * Jan. 11, 2012: Version 2.0.1 released. Bugfix for some attributes on Filing class.
16
17
 
17
18
  == INSTALL:
@@ -133,7 +133,7 @@ module CampaignCash
133
133
  create(result.first) if result.first
134
134
  end
135
135
 
136
- def self.search(name, cycle=CURRENT_CYCLE, offset=0)
136
+ def self.search(name, cycle=CURRENT_CYCLE, offset=nil)
137
137
  reply = invoke("#{cycle}/committees/search", {:query => name,:offset => offset})
138
138
  results = reply['results']
139
139
  results.map{|c| create_from_search_results(c)}
@@ -145,13 +145,13 @@ module CampaignCash
145
145
  results.map{|c| create_from_search_results(c)}
146
146
  end
147
147
 
148
- def self.superpacs(cycle=CURRENT_CYCLE, offset=0)
148
+ def self.superpacs(cycle=CURRENT_CYCLE, offset=nil)
149
149
  reply = invoke("#{cycle}/committees/superpacs",{:offset => offset})
150
150
  results = reply['results']
151
151
  results.map{|c| create_from_search_results(c)}
152
152
  end
153
153
 
154
- def filings(cycle=CURRENT_CYCLE, offset=0)
154
+ def filings(cycle=CURRENT_CYCLE, offset=nil)
155
155
  reply = Base.invoke("#{cycle}/committees/#{id}/filings",{:offset => offset})
156
156
  results = reply['results']
157
157
  results.map{|c| Filing.create(c)}
@@ -37,14 +37,14 @@ module CampaignCash
37
37
  end
38
38
 
39
39
 
40
- def self.today(offset=0)
40
+ def self.today(offset=nil)
41
41
  cycle=CURRENT_CYCLE
42
42
  reply = Base.invoke("#{cycle}/filings", {:offset => offset})
43
43
  results = reply['results']
44
44
  results.map{|c| Filing.create(c)}
45
45
  end
46
46
 
47
- def self.date(year, month, day, offset=0)
47
+ def self.date(year, month, day, offset=nil)
48
48
  cycle = cycle_from_date(Date.strptime("#{month}/#{day}/#{year}", '%m/%d/%Y'))
49
49
  reply = Base.invoke("#{cycle}/filings/#{year}/#{month}/#{day}", {:offset => offset})
50
50
  results = reply['results']
@@ -25,13 +25,13 @@ module CampaignCash
25
25
  :date_received => date_parser(params['date_received'])
26
26
  end
27
27
 
28
- def self.latest(offset=0)
28
+ def self.latest(offset=nil)
29
29
  reply = Base.invoke("#{Base::CURRENT_CYCLE}/independent_expenditures",{:offset => offset})
30
30
  results = reply['results']
31
31
  results.map{|c| IndependentExpenditure.create(c)}
32
32
  end
33
33
 
34
- def self.date(date,offset=0)
34
+ def self.date(date,offset=nil)
35
35
  d = Date.strptime(date, '%m/%d/%Y')
36
36
  cycle = cycle_from_date(d)
37
37
  reply = Base.invoke("#{cycle}/independent_expenditures/#{d.year}/#{d.month}/#{d.day}",{:offset => offset})
@@ -39,7 +39,7 @@ module CampaignCash
39
39
  results.map{|c| IndependentExpenditure.create(c)}
40
40
  end
41
41
 
42
- def self.committee(id, cycle, offset=0)
42
+ def self.committee(id, cycle, offset=nil)
43
43
  independent_expenditures = []
44
44
  reply = Base.invoke("#{cycle}/committees/#{id}/independent_expenditures",{:offset => offset})
45
45
  results = reply['results']
@@ -51,7 +51,7 @@ module CampaignCash
51
51
  independent_expenditures
52
52
  end
53
53
 
54
- def self.candidate(id, cycle, offset=0)
54
+ def self.candidate(id, cycle, offset=nil)
55
55
  independent_expenditures = []
56
56
  reply = Base.invoke("#{cycle}/candidates/#{id}/independent_expenditures",{:offset => offset})
57
57
  results = reply['results']
@@ -63,7 +63,7 @@ module CampaignCash
63
63
  independent_expenditures
64
64
  end
65
65
 
66
- def self.president(cycle=CURRENT_CYCLE,offset=0)
66
+ def self.president(cycle=CURRENT_CYCLE,offset=nil)
67
67
  reply = Base.invoke("#{cycle}/president/independent_expenditures",{:offset => offset})
68
68
  results = reply['results']
69
69
  results.map{|c| IndependentExpenditure.create(c)}
@@ -1,3 +1,3 @@
1
1
  module CampaignCash
2
- VERSION = "2.0.1"
2
+ VERSION = "2.0.2"
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: campaign_cash
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 2
8
8
  - 0
9
- - 1
10
- version: 2.0.1
9
+ - 2
10
+ version: 2.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Derek Willis
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-01-11 00:00:00 -05:00
18
+ date: 2012-01-13 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency