Class: GovKit::VoteSmart::Category

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

.list(state_id) ⇒ Object

Raises:



106
107
108
109
110
111
112
# File 'lib/gov_kit/vote_smart.rb', line 106

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

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

  parse(response['categories']['category'])
end