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



124
125
126
127
# File 'lib/gov_kit/vote_smart.rb', line 124

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

.list(category_id, state_id) ⇒ Object

Raises:



116
117
118
119
120
121
122
# File 'lib/gov_kit/vote_smart.rb', line 116

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