Class: GovKit::TransparencyData::Contribution

Inherits:
GovKit::TransparencyDataResource show all
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

#attributes, #raw_response

Class Method Summary collapse

Methods inherited from GovKit::TransparencyDataResource

from_response, search_for

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