Class: GovKit::VoteSmart::Rating

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

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(candidate_id, sig_id) ⇒ Object

Raises:



131
132
133
134
135
136
137
# File 'lib/gov_kit/vote_smart.rb', line 131

def self.find(candidate_id, sig_id)
  response = get("/Rating.getCandidateRating", :query => {"candidateId" => candidate_id, "sigId" => sig_id})

  raise(ResourceNotFound, response['error']['errorMessage']) if response['error']

  parse(response['candidateRating']['rating'])
end