Class: GovKit::TransparencyData::Contribution
- Inherits:
-
GovKit::TransparencyDataResource
- Object
- Resource
- GovKit::TransparencyDataResource
- GovKit::TransparencyData::Contribution
- Defined in:
- lib/gov_kit/transparency_data.rb
Overview
Represents contributions.
See transparencydata.com/api/contributions/ for complete query options.
Instance Attribute Summary
Attributes inherited from Resource
Class Method Summary collapse
-
.find(ops = {}) ⇒ Object
Deprecated.
-
.search(ops = {}) ⇒ Object
Search for contribution records.
Methods inherited from GovKit::TransparencyDataResource
Methods inherited from Resource
#initialize, instantiate, instantiate_collection, parse, #to_md5, #unload
Constructor Details
This class inherits a constructor from GovKit::Resource
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class GovKit::Resource
Class Method Details
.find(ops = {}) ⇒ Object
Deprecated. Use search instead.
32 33 34 35 36 |
# File 'lib/gov_kit/transparency_data.rb', line 32 def self.find(ops = {}) puts "GovKit::TransparencyData::Contribution.find is deprecated. Use Contribution.search instead." response = get('/contributions.json', :query => ops) parse(response) end |
.search(ops = {}) ⇒ Object
Search for contribution records.
Example query:
contributions = GovKit::TransparencyData::Contribution.search( { 'contributor_state' => 'md', 'recipient_ft' => 'mikulski', 'cycle' => '2008', 'per_page' => '3' } )
42 43 44 |
# File 'lib/gov_kit/transparency_data.rb', line 42 def self.search(ops = {}) search_for('/contributions.json', ops) end |