mashery_rails
A Rails library for the Mashery API.
Includes:
config/mashery.ymlconfig file- A simple Query generator for the RPC API, and it's SQL-esque syntax
- Good test coverage
Installation
Add the following to your Gemfile
gem "mashery_rails", require: "mashery"
Then run the installer to create config/mashery.yml
$ rails g mashery:install
Configuration
Edit config/mashery.yml with your site_key, key and secret options.
---
site_id: '123'
key: "abc"
secret: "xyz"
host: "api.mashery.com"
Note this doesn't distinguish between development, testing, production, etc. If you really need that functionality, open a new issue.
Usage
The central data objects are all listed on the RPC API documentation page, and should be supported. However, fetching objects are the main & typically only supported method for each of these objects. If you feel you want to support more methods, feel free to create a pull request.
all
Fetch all objects of a particular type.
Mashery::Member.all #=>
first
Fetch the first object of a particular type.
Mashery::Member.first #=>

