Class: GovKit::VoteSmart::Committee
- Inherits:
-
GovKit::VoteSmartResource
- Object
- Resource
- GovKit::VoteSmartResource
- GovKit::VoteSmart::Committee
- Defined in:
- lib/gov_kit/vote_smart.rb
Overview
Instance Attribute Summary
Attributes inherited from Resource
Class Method Summary collapse
-
.find(committee_id) ⇒ Object
Find a committee by VoteSmart committeeId.
-
.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.
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 |