campaign_cash 1.7 → 1.8

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -51,6 +51,7 @@ Check out the tests for further examples.
51
51
  == Authors
52
52
 
53
53
  Derek Willis, dwillis@nytimes.com
54
+ Jason Holt, jjh@offensivepolitics.net
54
55
 
55
56
  == Copyright
56
57
 
@@ -67,8 +67,8 @@ module CampaignCash
67
67
  create(result.first) if result.first
68
68
  end
69
69
 
70
- def self.search(name, cycle=CURRENT_CYCLE)
71
- reply = invoke("#{cycle}/committees/search", {:query => name})
70
+ def self.search(name, cycle=CURRENT_CYCLE, offset=0)
71
+ reply = invoke("#{cycle}/committees/search", {:query => name,:offset => offset})
72
72
  results = reply['results']
73
73
  results.map{|c| create_from_search_results(c)}
74
74
  end
@@ -79,8 +79,8 @@ module CampaignCash
79
79
  results.map{|c| create(c)}
80
80
  end
81
81
 
82
- def self.superpacs(cycle=CURRENT_CYCLE)
83
- reply = invoke("#{cycle}/committees/superpacs")
82
+ def self.superpacs(cycle=CURRENT_CYCLE, offset=0)
83
+ reply = invoke("#{cycle}/committees/superpacs",{:offset => offset})
84
84
  results = reply['results']
85
85
  results.map{|c| create_from_search_results(c)}
86
86
  end
@@ -31,17 +31,17 @@ module CampaignCash
31
31
  @independent_expenditures = results.map{|c| IndependentExpenditure.create(c)}
32
32
  end
33
33
 
34
- def self.date(date)
34
+ def self.date(date,offset=0)
35
35
  d = Date.strptime(date, '%m/%d/%Y')
36
36
  cycle = cycle_from_date(d)
37
- reply = Base.invoke("#{cycle}/independent_expenditures/#{d.year}/#{d.month}/#{d.day}")
37
+ reply = Base.invoke("#{cycle}/independent_expenditures/#{d.year}/#{d.month}/#{d.day}",{:offset => offset})
38
38
  results = reply['results']
39
39
  @independent_expenditures = results.map{|c| IndependentExpenditure.create(c)}
40
40
  end
41
41
 
42
- def self.committee(id, cycle)
42
+ def self.committee(id, cycle, offset=0)
43
43
  @independent_expenditures = []
44
- reply = Base.invoke("#{cycle}/committees/#{id}/independent_expenditures")
44
+ reply = Base.invoke("#{cycle}/committees/#{id}/independent_expenditures",{:offset => offset})
45
45
  results = reply['results']
46
46
  comm = reply['fec_committee']
47
47
  results.each do |result|
@@ -51,9 +51,9 @@ module CampaignCash
51
51
  @independent_expenditures
52
52
  end
53
53
 
54
- def self.candidate(id, cycle)
54
+ def self.candidate(id, cycle, offset=0)
55
55
  @independent_expenditures = []
56
- reply = Base.invoke("#{cycle}/candidates/#{id}/independent_expenditures")
56
+ reply = Base.invoke("#{cycle}/candidates/#{id}/independent_expenditures",{:offset => offset})
57
57
  results = reply['results']
58
58
  cand = reply['fec_candidate']
59
59
  results.each do |result|
@@ -63,8 +63,8 @@ module CampaignCash
63
63
  @independent_expenditures
64
64
  end
65
65
 
66
- def self.president(cycle=Base::CURRENT_CYCLE)
67
- reply = Base.invoke("#{cycle}/president/independent_expenditures")
66
+ def self.president(cycle=Base::CURRENT_CYCLE,offset=0)
67
+ reply = Base.invoke("#{cycle}/president/independent_expenditures",{:offset => offset})
68
68
  results = reply['results']
69
69
  @independent_expenditures = results.map{|c| IndependentExpenditure.create(c)}
70
70
  end
@@ -1,3 +1,3 @@
1
1
  module CampaignCash
2
- VERSION = "1.7"
2
+ VERSION = "1.8"
3
3
  end
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: campaign_cash
3
3
  version: !ruby/object:Gem::Version
4
- hash: 1
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
- - 7
9
- version: "1.7"
8
+ - 8
9
+ version: "1.8"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Derek Willis
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2011-12-20 00:00:00 -05:00
17
+ date: 2011-12-29 00:00:00 -05:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency