Sha256: e330dad9b77c44e0333c3f76adaa3cf007370a385efaaceccf9350d8b16a1ea2

Contents?: true

Size: 1.6 KB

Versions: 1

Compression:

Stored size: 1.6 KB

Contents

# mashery_rails

[![Coverage Status](https://coveralls.io/repos/farleyknight/masheri/badge.png)](https://coveralls.io/r/farleyknight/masheri)

[![Build Status](https://travis-ci.org/farleyknight/mashery_rails.png?branch=master)](https://travis-ci.org/farleyknight/mashery_rails)


A Rails library for the [Mashery API](http://support.mashery.com/docs/mashery_api).

Includes:

* `config/mashery.yml` config 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`

```ruby
gem "mashery_rails", require: "mashery"
```

Then run the installer to create `config/mashery.yml`

```bash
$ rails g mashery:install
```

## Configuration

Edit `config/mashery.yml` with your `site_key`, `key` and `secret` options.

```yaml
---
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](http://support.mashery.com/docs/read/mashery_api/20/API_Objects), and should be supported. However, [fetching objects](http://support.mashery.com/docs/read/mashery_api/20/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.

```ruby
Mashery::Member.all #=>
```

### `first`

Fetch the first object of a particular type.

```ruby
Mashery::Member.first #=>
```

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mashery_rails-0.6.2 README.md