Class: OpenFec::Resources::IndependentExpenditures

Inherits:
Base
  • Object
show all
Defined in:
lib/open_fec/resources/independent_expenditures.rb

Overview

Independent expenditures (Schedule E) — Super PAC and outside group spending for or against candidates.

Examples:

Super PAC spending for/against a candidate

OpenFec.independent_expenditures.by_candidate(candidate_id: 'H4VA08224', cycle: 2024)

Totals by candidate

OpenFec.independent_expenditures.totals_by_candidate(candidate_id: 'H4VA08224', cycle: 2024)

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from OpenFec::Resources::Base

Instance Method Details

#by_candidate(**params) ⇒ OpenFec::Response

Independent expenditures aggregated by candidate. Shows committee_name, support/oppose indicator, total amount.

Parameters:

  • params (Hash)

    filters (:candidate_id, :cycle, :office, :state, :district)

Returns:



29
30
31
# File 'lib/open_fec/resources/independent_expenditures.rb', line 29

def by_candidate(**params)
  get('schedules/schedule_e/by_candidate/', params)
end

#each_page(**params) {|OpenFec::Response| ... } ⇒ Object

Paginate through itemized independent expenditures (seek-based).

Parameters:

  • params (Hash)

    filters

Yields:



45
46
47
# File 'lib/open_fec/resources/independent_expenditures.rb', line 45

def each_page(**params, &)
  client.paginate_seek('schedules/schedule_e/', params, &)
end

#list(**params) ⇒ OpenFec::Response

List itemized independent expenditures (Schedule E). Uses seek/cursor-based pagination.

Parameters:

  • params (Hash)

    filters (:committee_id, :candidate_id, :cycle, :support_oppose_indicator — “S” for support, “O” for oppose, etc.)

Returns:



20
21
22
# File 'lib/open_fec/resources/independent_expenditures.rb', line 20

def list(**params)
  get('schedules/schedule_e/', params)
end

#totals_by_candidate(**params) ⇒ OpenFec::Response

Totals of independent expenditures by candidate.

Parameters:

  • params (Hash)

    filters (:candidate_id, :cycle, :election_full)

Returns:



37
38
39
# File 'lib/open_fec/resources/independent_expenditures.rb', line 37

def totals_by_candidate(**params)
  get('schedules/schedule_e/totals/by_candidate/', params)
end