Class: OpenSecrets::Organization

Inherits:
Base
  • Object
show all
Defined in:
lib/opensecrets.rb

Overview

committee

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from OpenSecrets::Base

Instance Method Details

#get_orgs(options = {}) ⇒ Object

Look up an organization by name.

See : www.opensecrets.org/api/?method=getOrgs&output=doc

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :org (String) — default: ""

    name or partial name of organization requested

Raises:

  • (ArgumentError)


156
157
158
159
160
# File 'lib/opensecrets.rb', line 156

def get_orgs(options = {})
  raise ArgumentError, 'You must provide a :org option' if options[:org].nil? || options[:org].empty?
  options.merge!({:method => 'getOrgs'})
  self.class.get("/", :query => options)
end

#org_summary(options = {}) ⇒ Object

Provides summary fundraising information for the specified organization id.

See : www.opensecrets.org/api/?method=orgSummary&output=doc

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :org (String) — default: ""

    CRP orgid (available via ‘get_orgs’ method)

Raises:

  • (ArgumentError)


168
169
170
171
172
# File 'lib/opensecrets.rb', line 168

def org_summary(options = {})
  raise ArgumentError, 'You must provide a :id option' if options[:id].nil? || options[:id].empty?
  options.merge!({:method => 'orgSummary'})
  self.class.get("/", :query => options)
end