Class: GovKit::VoteSmart::SIG

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



49
50
51
52
# File 'lib/gov_kit/vote_smart.rb', line 49

def self.find(sig_id)
  response = get("/Rating.getSig", :query => {"sigId" => sig_id})
  parse(response['sig'])
end

.list(category_id, state_id) ⇒ Object

Raises:



41
42
43
44
45
46
47
# File 'lib/gov_kit/vote_smart.rb', line 41

def self.list(category_id, state_id)
  response = get("/Rating.getSigList", :query => {"categoryId" => category_id, "stateId" => state_id})

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

  parse(response['sigs']['sig'])
end