Class: GovKit::VoteSmart::Bio
- Inherits:
-
GovKit::VoteSmartResource
- Object
- Resource
- GovKit::VoteSmartResource
- GovKit::VoteSmart::Bio
- Defined in:
- lib/gov_kit/vote_smart.rb
Instance Attribute Summary
Attributes inherited from Resource
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(candidate_id, include_office = false) ⇒ Object
90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'lib/gov_kit/vote_smart.rb', line 90 def self.find(candidate_id, include_office = false) response = get("/CandidateBio.getBio", :query => {"candidateId" => candidate_id}) return false if response.blank? || response['error'] # Previous versions ommitted "office" data from response. # include_office is optional so to not break backwards compatibility. if include_office parse(response['bio']) else parse(response['bio']['candidate']) end end |