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
160
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
150
Extending Kubernetes with Operators/Controllers
christopherhein
0
26
Rails Engines
christopherhein
0
120
Other Decks in Programming
See All in Programming
フロントエンド開発に役立つクライアントプログラム共通のノウハウ / Universal client-side programming best practices for frontend development
nrslib
7
3.9k
タスクの特性や不確実性に応じた最適な作業スタイルの選択(ペアプロ・モブプロ・ソロプロ)と実践 / Optimal Work Style Selection: Pair, Mob, or Solo Programming.
honyanya
3
140
止められない医療アプリ、そっと Swift 6 へ
medley
1
120
iOSアプリの信頼性を向上させる取り組み/ios-app-improve-reliability
shino8rayu9
0
150
複雑化したリポジトリをなんとかした話 pipenvからuvによるモノレポ構成への移行
satoshi256kbyte
1
770
CI_CD「健康診断」のススメ。現場でのボトルネック特定から、健康診断を通じた組織的な改善手法
teamlab
PRO
0
180
uniqueパッケージの内部実装を支えるweak pointerの話
magavel
0
920
なぜあの開発者はDevRelに伴走し続けるのか / Why Does That Developer Keep Running Alongside DevRel?
nrslib
3
370
AI Coding Meetup #3 - 導入セッション / ai-coding-meetup-3
izumin5210
0
580
ててべんす独演会〜Flowの全てを語ります〜
tbsten
1
220
エンジニアとして高みを目指す、 利益を生み出す設計の考え方 / design-for-profit
minodriven
23
12k
私はどうやって技術力を上げたのか
yusukebe
43
17k
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Code Review Best Practice
trishagee
72
19k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.7k
Raft: Consensus for Rubyists
vanstee
139
7.1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
33
2.5k
Learning to Love Humans: Emotional Interface Design
aarron
274
40k
Docker and Python
trallard
46
3.6k
Documentation Writing (for coders)
carmenintech
75
5k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
5.6k
The Language of Interfaces
destraynor
162
25k
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...