Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Grape APIs
Search
Christopher Hein
December 18, 2012
Programming
2
140
Grape APIs
Christopher Hein
December 18, 2012
Tweet
Share
More Decks by Christopher Hein
See All by Christopher Hein
Controllers and Service Catalog; The Power of CRDs
christopherhein
0
140
Extending Kubernetes with Operators/Controllers
christopherhein
0
17
Rails Engines
christopherhein
0
110
Other Decks in Programming
See All in Programming
What We Can Learn From OSS
inouehi
0
440
Elm 0.19.0 Changes
bkuhlmann
0
510
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
9
4.2k
スキーマ駆動開発による品質とスピードの両立 - 私達は何故、スキーマを書くのか
kentaroutakeda
0
180
使ってみよう Azure AI Document Intelligence
kosmosebi
2
360
Java 22 Overview
kishida
1
190
Deep Dive into React Stream/Serialize
mugi_uno
3
680
Komplexe Oberflächen mit SVG und der Web Animation API
joergneumann
0
680
try! Swift Tokyo 初参加報告LT
hinakko2
0
240
AWS CDKコントリビュートTIPS / aws-cdk-contribution-tips
gotok365
4
380
Milestoner
bkuhlmann
1
410
障害対応を起点としたもっといい開発と運用のサイクル作りのためにできること / Hatena Enginner Seminar #29
polamjag
0
390
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
155
14k
Making the Leap to Tech Lead
cromwellryan
125
8.5k
Designing Experiences People Love
moore
136
23k
Building an army of robots
kneath
300
41k
Code Review Best Practice
trishagee
56
15k
Product Roadmaps are Hard
iamctodd
45
9.7k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
117
18k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
41
4.4k
Bootstrapping a Software Product
garrettdimon
PRO
302
110k
How to Ace a Technical Interview
jacobian
273
22k
Art, The Web, and Tiny UX
lynnandtonic
290
19k
Building Adaptive Systems
keathley
32
1.9k
Transcript
APIs
Rails
Don’t really fit together.
Sinatra
mmm tasty...
But I’m good programmer... http://threevirtues.com/ (1)
Enter...
Grape 0.2.0!!!
Why@?#$%!
Simple... class API < Grape::API get :users do # omitted
for awesomeness end end
Versions... class API < Grape::API version “v1” get :users do
# omitted for awesomeness end end
Helpers... class API < Grape::API helpers do def current_user User.find
params[:id] end end # omitted for awesomeness end
Multi-file... class API < Grape::API version “v1” mount API_v1 #
omitted for awesomeness end
Describing... class API < Grape::API desc "Returns users", {params:{id: {}}}
get :users do # omitted for awesomeness end end
Demo...