class OpenCivicData::Client

Attributes

key[R]

Public Class Methods

new(key) click to toggle source
# 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

Public Instance Methods

bills(options = {}) click to toggle source

Legislative documents, resolutions, appointments or contract and its history, Bill’s type, legislative body, session, name, chamber, title, type, subject and summary.

@return [Hashie::Rash] @example

OpenCivicData.key = YOUR_SUNLIGHT_API_KEY
OpenCivicData.bills
# File lib/open_civic_data/client.rb, line 78
def bills(options = {})
  get('/bills/', options)
end
divisions(options = {}) click to toggle source

Divisions are political geographies such as a state, county, or congressional district. Division’s geometries and list of child jurisdiction ids.

@return [Hashie::Rash] @example

OpenCivicData.key = YOUR_SUNLIGHT_API_KEY
OpenCivicData.divisions
# File lib/open_civic_data/client.rb, line 34
def divisions(options = {})
  get('/divisions/', options)
end
events(options = {}) click to toggle source

A legislative event, such as a meeting or hearing. Event’s type, name, description, when, end, status, location, and linked entities.

@return [Hashie::Rash] @example

OpenCivicData.key = YOUR_SUNLIGHT_API_KEY
OpenCivicData.events
# File lib/open_civic_data/client.rb, line 67
def events(options = {})
  get('/events/', options)
end
jurisdictions(options = {}) click to toggle source

Jurisdictions are governing bodies that exists within a division. Jurisdiction’s name, url, chambers, terms, and session details.

return [Hashie::Rash] @example

OpenCivicData.key = YOUR_SUNLIGHT_API_KEY
OpenCivicData.jurisdictions
# File lib/open_civic_data/client.rb, line 23
def jurisdictions(options = {})
  get('/jurisdictions/', options)
end
organizations(options = {}) click to toggle source

A group of people, such as a city council, state senate, or committee. Organization’s name, classification, parent id, contact details, links and posts.

@return [Hashie::Rash] @example

OpenCivicData.key = YOUR_SUNLIGHT_API_KEY
OpenCivicData.organizations
# File lib/open_civic_data/client.rb, line 56
def organizations(options = {})
  get('/organizations/', options)
end
people(options = {}) click to toggle source

People, typically a politician or gov official. Person’s name, image, contact details, and links.

@return [Hashie::Rash] @example

OpenCivicData.key = YOUR_SUNLIGHT_API_KEY
OpenCivicData.people
# File lib/open_civic_data/client.rb, line 45
def people(options = {})
  get('/people/', options)
end
votes(options = {}) click to toggle source

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.

@return [Hashie::Rash] @example

OpenCivicData.key = YOUR_SUNLIGHT_API_KEY
OpenCivicData.votes
# File lib/open_civic_data/client.rb, line 89
def votes(options = {})
  get('/votes/', options)
end