0.01
No commit activity in last 3 years
No release in over 3 years
A source for data about the 2016 United States Presidential election. Includes a "candidates" endpoint.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 0.10
~> 10.0
~> 3.3

Runtime

~> 1.8.3
 Project Readme

TwentySixteen

Gem Version

A source for data about the 2016 United States Presidential election. Includes a candidates endpoint.

Installation

Add this line to your application's Gemfile:

gem 'twenty_sixteen'

And then execute:

$ bundle

Or install it yourself as:

$ gem install twenty_sixteen

Usage

Client-side

Request the hosted JSON data file.

Server-side

Candidates

List all candidates running for President.

candidates = TwentySixteen::Candidate.all

Filter candidates.

dems = TwentySixteen::Candidate.democrat

reps = TwentySixteen::Candidate.republican

indies = TwentySixteen::Candidate.independent

active_dems = TwentySixteen::Candidate.where({:party=>"Democrat",:campaign_status=>"active"})

party_nomination_winners = TwentySixteen::Candidate.party_nominee

Find a specific candidate.

hrc = TwentySixteen::Candidate.find_by_url("https://www.hillaryclinton.com/")

donald = TwentySixteen::Candidate.find_by_last_name("Trump")

Contributing

Edit candidate data in lib/twenty_sixteen/candidates.json. Please add new slogans in sequential order of appearance.

  1. Fork it ( https://github.com/debate-watch/twenty_sixteen/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request