Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Grape APIs
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
11
Rails Engines
christopherhein
0
92
Other Decks in Programming
See All in Programming
【DevFest & ADS JP 22】チームで導入する
[email protected]
おいしい健康
kako351
0
210
Hasura の Relationship と権限管理
karszawa
0
140
eBPF와 함께 이해하는 Cilium 네트워킹
hadaney
3
830
Step Functions Distributed Map を使ってみた
codemountains
0
100
Amazon QuickSightのアップデート -re:Invent 2022の復習&2022年ハイライト-
shogo452
0
200
23年のJavaトレンドは?Quarkusで理解するコンテナネイティブJava
tatsuya1bm
1
110
Spring BootとKubernetesで実現する今どきのDevOps入門
xblood
0
330
[2023년 1월 세미나] 데이터 분석가 되면 어떤 일을 하나요?
datarian
0
530
AWS App Runnerがそろそろ本番環境でも使い物になりそう
n1215
PRO
0
840
Swift Expression Macros: a practical introduction
kishikawakatsumi
2
690
Zynq MP SoC で楽しむエッジコンピューティング ~RTLプログラミングのススメ~
ryuz88
0
170
Hono v3 - Do Everything, Run Anywhere, But Small, And Faster
yusukebe
4
120
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
69
7.5k
Raft: Consensus for Rubyists
vanstee
130
5.7k
For a Future-Friendly Web
brad_frost
166
7.7k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
318
19k
Done Done
chrislema
178
14k
Bootstrapping a Software Product
garrettdimon
299
110k
Imperfection Machines: The Place of Print at Facebook
scottboms
254
12k
jQuery: Nuts, Bolts and Bling
dougneiner
57
6.6k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
236
1.1M
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
101
6.1k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
15
1.2k
Visualization
eitanlees
128
12k
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!!!
[email protected]
?#$%!
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...