Class: OpenSecrets::Committee

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

Overview

candidate

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from OpenSecrets::Base

Instance Method Details

#by_industry(options = {}) ⇒ Object

Provides summary fundraising information for a specific committee, industry and Congress number.

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

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :cmte (String) — default: ""

    Committee ID in CQ format

  • :congno (String) — default: ""

    Congress Number (like 110)

  • :indus (String) — default: ""

    Industry code

Raises:

  • (ArgumentError)


138
139
140
141
142
143
144
# File 'lib/opensecrets.rb', line 138

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