Message pack formatter for grape.
Add this line to your application's Gemfile:
gem 'grape-msgpack'
And then execute:
$ bundle
Or install it yourself as:
$ gem install grape-msgpack
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
- 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