Ruby client for the enigma api
Ruby client for the enigma api located at https://app.enigma.io/api. Supports ruby >= 1.9.3
Note that you need an api key to use their api.
Installation
Add this line to your application's Gemfile:
gem 'enigma_io'
And then execute:
$ bundle
Or install it yourself as:
$ gem install enigma_io
Usage
Basic usage is straightforward. There are also more detailed data api examples and export api examples available.
# Defaults to looking for key in ENV['ENIGMA_KEY']
client = Enigma::Client.new(key: :secret_key)
client.meta('us.gov.whitehouse.visitor-list')
res = client.data('us.gov.whitehouse.visitor-list')
# get some data
res.result.map { |r| ... }
client.stats('us.gov.whitehouse.visitor-list', select: 'type_of_access')
client.export('us.gov.whitehouse.visitor-list').parse.each do |row|
puts row.inspect
end
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Notes
You'll need to have rubocop installed.
gem install rubocop
Tests are run with rake
. Check the test coverage (printed when you
run rake) as well as the output of rubocop (also run with rake).
License
MIT license