Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

About

Message pack formatter for grape

Resources

License

Packages

No packages published

Languages