Message pack formatter for grape
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
spec
.coveralls.yml
.gitignore
.rspec
.travis.yml
Gemfile
LICENSE.txt
README.md
Rakefile
grape-msgpack.gemspec

README.md

Grape::Msgpack

Gem Version Build Status Coverage Status Code Climate

Message pack formatter for grape.

Installation

Add this line to your application's Gemfile:

gem 'grape-msgpack'

And then execute:

$ bundle

Or install it yourself as:

$ gem install grape-msgpack

Usage

set default format msgpack:

class TwitterAPI < Grape::API
  default_format :msgpack
end

and grape-msgpack supoorts grape-entity:

class ModelEntity < Grape::Entity
  expose :id
end

class ModelAPI < Grape::API
  default_format :msgpack

  get ':id' do
    present Model.find(params[:id]), with: ModelEntity
    # => { 'id' => 1 }
  end
end

Contributing

  1. Fork it
  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 new Pull Request