Emma API Wrapper (Ruby)
A Ruby wrapper for Emma's API.
Running the tests
Set the following environment values
export EMMA_ACCOUNT_ID=123456
export EMMA_PUBLIC_KEY=6fbfd5e68d3306e51350
export EMMA_PRIVATE_KEY=53f42aa48e24d44a3362
Run the tests
bundle exec rake run_tests
Installation
Add this line to your application's Gemfile:
gem 'emma'
And then execute:
$ bundle
Or install it yourself as:
$ gem install emma
Usage
Instantiation
require 'emma'
em = Emma::Setup.new 'account_id', 'public_key', 'private_key', 'debug_true_or_false'
You can also set environment variables and the Emma Wrapper will use them when you create an instance
ENV['EMMA_ACCOUNT_ID'] = 'account_id'
ENV['EMMA_PUBLIC_KEY'] = 'public_key'
ENV['EMMA_PRIVATE_KEY'] = 'private_key'
em = Emma::Setup.new
GET Request
req = em.my_members
puts req.inspect
req = em.my_members count: true
puts req.inspect
req = em.my_members start: 0, end: 200
puts req.inspect
POST Request
req = em.add_member email: "helloworld@gmail.com", fields: { first_name: 'hello', last_name: 'world' }
puts req.inspect
PUT Request
req = em.update_member 111, status: 'e'
puts req.inspect
DELETE Request
req = em.remove_member 111
puts req.inspect
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