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
puregoの活用例
aethiopicuschan
0
220
1인 개발자로 행복하게 살기 - GDG 송도 헬로월드 2024
benjaminkim
1
5.6k
Ruby Function Composition
bkuhlmann
1
330
Folding Cheat Sheet #1
philipschwarz
PRO
0
210
try! Swift Tokyo 2024のLT枠に採択されたプロポーザルを出すときに考えていたこと
ski
0
340
Rails と人魚の話/rails-and-mermaid
sanfrecce_osaka
0
100
Tailwind CSSを本気でカスタマイズする方法
fsubal
7
1.9k
StreamlitとTerraformでデータカタログを作った話
gussan0223
0
310
コーンフレークから始める モデリング会話入門
ogurotakayuki
0
280
本格ローグライク制作にEbitengineを選んでみた
nagainaganawa
0
290
PHP8.3の機能を振り返る / Review of PHP 8.3 features
seike460
PRO
1
110
Javaエンジニアのための Nodejs/Nuxt3入門
hidekatsu_izuno
0
280
Featured
See All Featured
KATA
mclloyd
14
12k
Bootstrapping a Software Product
garrettdimon
PRO
301
110k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
243
20k
Teambox: Starting and Learning
jrom
128
8.4k
A better future with KSS
kneath
231
16k
Scaling GitHub
holman
457
140k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
Visualization
eitanlees
135
14k
Why You Should Never Use an ORM
jnunemaker
PRO
50
8.6k
How STYLIGHT went responsive
nonsquared
92
4.8k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
10 Git Anti Patterns You Should be Aware of
lemiorhan
646
57k
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...