Class: GovKit::VoteSmart::Committee

Inherits:
GovKit::VoteSmartResource show all
Defined in:
lib/gov_kit/vote_smart.rb

Overview

Instance Attribute Summary

Attributes inherited from Resource

#attributes, #raw_response

Class Method Summary collapse

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(committee_id) ⇒ Object

Find a committee by VoteSmart committeeId. Maps to Committee.getCommittee()



120
121
122
123
# File 'lib/gov_kit/vote_smart.rb', line 120

def self.find(committee_id)
  response = get('/Committee.getCommittee', :query => {'committeeId' => committee_id})
  parse(response['committee'])
end

.find_by_type_and_state(type_id, state_abbrev) ⇒ Object

Find a committee by VoteSmart typeId and stateId (abbreviation) If type_id is nil, defaults to all types. This method maps to Committee.getCommitteesByTypeState()



114
115
116
117
# File 'lib/gov_kit/vote_smart.rb', line 114

def self.find_by_type_and_state(type_id, state_abbrev)
  response = get('/Committee.getCommitteesByTypeState', :query => {'typeId' => type_id, 'stateId' => state_abbrev})
  parse(response['committees'])
end