Class: OpenSecrets::Member

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

Instance Method Summary (collapse)

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from OpenSecrets::Base

Instance Method Details

- (Object) pfd(options = {})

Returns Personal Financial Disclosure (PFD) information for a member of Congress.

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

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :cid (String) — default: ""

    a CRP CandidateID

  • :year (String) — default: ""

    Get data for specified year.

Raises:

  • (ArgumentError)


36
37
38
39
40
41
# File 'lib/opensecrets.rb', line 36

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

- (Object) trips(options = {})

Provides a list of trips paid for by private organizations taken by a specified member or their staff.

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

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :cid (String) — default: ""

    a CRP CandidateID

  • :year (String) — default: ""

    Get data for specified year.

Raises:

  • (ArgumentError)


50
51
52
53
54
55
# File 'lib/opensecrets.rb', line 50

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