Class: OpenCivicData::Client
- Inherits:
-
Object
- Object
- OpenCivicData::Client
- Includes:
- Connection, Request
- Defined in:
- lib/open_civic_data/client.rb
Constant Summary
Constants included from Connection
OpenCivicData::Connection::ENDPOINT
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
Instance Method Summary collapse
-
#bills(options = {}) ⇒ Hashie::Rash
Legislative documents, resolutions, appointments or contract and its history, Bill's type, legislative body, session, name, chamber, title, type, subject and summary.
-
#divisions(options = {}) ⇒ Hashie::Rash
Divisions are political geographies such as a state, county, or congressional district.
-
#events(options = {}) ⇒ Hashie::Rash
A legislative event, such as a meeting or hearing.
-
#initialize(key) ⇒ Client
constructor
A new instance of Client.
-
#jurisdictions(options = {}) ⇒ Object
Jurisdictions are governing bodies that exists within a division.
-
#organizations(options = {}) ⇒ Hashie::Rash
A group of people, such as a city council, state senate, or committee.
-
#people(options = {}) ⇒ Hashie::Rash
People, typically a politician or gov official.
-
#votes(options = {}) ⇒ Hashie::Rash
The record of a vote taken on a motion.
Methods included from Request
Constructor Details
#initialize(key) ⇒ Client
Returns a new instance of Client.
11 12 13 14 |
# File 'lib/open_civic_data/client.rb', line 11 def initialize(key) warn 'Warning: Your API key may not be set.' if key.nil? @key = key end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
9 10 11 |
# File 'lib/open_civic_data/client.rb', line 9 def key @key end |
Instance Method Details
#bills(options = {}) ⇒ Hashie::Rash
Legislative documents, resolutions, appointments or contract and its history, Bill's type, legislative body, session, name, chamber, title, type, subject and summary.
78 79 80 |
# File 'lib/open_civic_data/client.rb', line 78 def bills( = {}) get('/bills/', ) end |
#divisions(options = {}) ⇒ Hashie::Rash
Divisions are political geographies such as a state, county, or congressional district. Division's geometries and list of child jurisdiction ids.
34 35 36 |
# File 'lib/open_civic_data/client.rb', line 34 def divisions( = {}) get('/divisions/', ) end |
#events(options = {}) ⇒ Hashie::Rash
A legislative event, such as a meeting or hearing. Event's type, name, description, when, end, status, location, and linked entities.
67 68 69 |
# File 'lib/open_civic_data/client.rb', line 67 def events( = {}) get('/events/', ) end |
#jurisdictions(options = {}) ⇒ Object
Jurisdictions are governing bodies that exists within a division. Jurisdiction's name, url, chambers, terms, and session details.
return [Hashie::Rash]
23 24 25 |
# File 'lib/open_civic_data/client.rb', line 23 def jurisdictions( = {}) get('/jurisdictions/', ) end |
#organizations(options = {}) ⇒ Hashie::Rash
A group of people, such as a city council, state senate, or committee. Organization's name, classification, parent id, contact details, links and posts.
56 57 58 |
# File 'lib/open_civic_data/client.rb', line 56 def organizations( = {}) get('/organizations/', ) end |
#people(options = {}) ⇒ Hashie::Rash
People, typically a politician or gov official. Person's name, image, contact details, and links.
45 46 47 |
# File 'lib/open_civic_data/client.rb', line 45 def people( = {}) get('/people/', ) end |
#votes(options = {}) ⇒ Hashie::Rash
The record of a vote taken on a motion. May contain individual legilsator's yay/nay or outcome. Vote's organization, session, chamber, date, motion, type and passed or not.
89 90 91 |
# File 'lib/open_civic_data/client.rb', line 89 def votes( = {}) get('/votes/', ) end |