Class: OpenSecrets::Candidate
Overview
member
Instance Method Summary collapse
-
#contributions_by_industry(options = {}) ⇒ Object
Provides total contributed to specified candidate from specified industry for specified cycle.
-
#contributors(options = {}) ⇒ Object
Provides the top organizations contributing to specified politician.
-
#industries(options = {}) ⇒ Object
Provides the top industries contributing to a specified politician.
-
#sector(options = {}) ⇒ Object
Provides sector total of specified politician’s receipts.
-
#summary(options = {}) ⇒ Object
Provides summary fundraising information for specified politician.
Methods inherited from Base
Constructor Details
This class inherits a constructor from OpenSecrets::Base
Instance Method Details
#contributions_by_industry(options = {}) ⇒ Object
Provides total contributed to specified candidate from specified industry for specified cycle.
See : www.opensecrets.org/api/?method=candIndByInd&output=doc
106 107 108 109 110 111 |
# File 'lib/opensecrets.rb', line 106 def contributions_by_industry( = {}) raise ArgumentError, 'You must provide a :cid option' if [:cid].nil? || [:cid].empty? raise ArgumentError, 'You must provide a :ind option' if [:ind].nil? || [:ind].empty? .merge!({:method => 'CandIndByInd'}) self.class.get("/", :query => ) end |
#contributors(options = {}) ⇒ Object
Provides the top organizations contributing to specified politician.
See : www.opensecrets.org/api/?method=candContrib&output=doc
79 80 81 82 83 |
# File 'lib/opensecrets.rb', line 79 def contributors( = {}) raise ArgumentError, 'You must provide a :cid option' if [:cid].nil? || [:cid].empty? .merge!({:method => 'candContrib'}) self.class.get("/", :query => ) end |
#industries(options = {}) ⇒ Object
Provides the top industries contributing to a specified politician.
See : www.opensecrets.org/api/?method=candIndustry&output=doc
92 93 94 95 96 |
# File 'lib/opensecrets.rb', line 92 def industries( = {}) raise ArgumentError, 'You must provide a :cid option' if [:cid].nil? || [:cid].empty? .merge!({:method => 'candIndustry'}) self.class.get("/", :query => ) end |
#sector(options = {}) ⇒ Object
Provides sector total of specified politician’s receipts.
120 121 122 123 124 |
# File 'lib/opensecrets.rb', line 120 def sector( = {}) raise ArgumentError, 'You must provide a :cid option' if [:cid].nil? || [:cid].empty? .merge!({:method => 'candSector'}) self.class.get("/", :query => ) end |
#summary(options = {}) ⇒ Object
Provides summary fundraising information for specified politician.
See : www.opensecrets.org/api/?method=candSummary&output=doc
66 67 68 69 70 |
# File 'lib/opensecrets.rb', line 66 def summary( = {}) raise ArgumentError, 'You must provide a :cid option' if [:cid].nil? || [:cid].empty? .merge!({:method => 'candSummary'}) self.class.get("/", :query => ) end |