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
Safe Navigation in Ruby 2.3
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Rick Liu
January 22, 2016
Programming
74
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Safe Navigation in Ruby 2.3
Introduction the new operator and its problem.
Rick Liu
January 22, 2016
More Decks by Rick Liu
See All by Rick Liu
Functional Programming Concepts
rickliu
0
230
You Don't Need a JavaScript Framework
rickliu
0
130
Agile Design
rickliu
0
85
Active Job in Rails 4.2
rickliu
0
65
Other Decks in Programming
See All in Programming
Dockerfile CMD for Node.js
grazie1999
0
110
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
4
490
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
670
使いながら育てる Claude Code — 開発フローの1コマンド化 × 繰り返し指摘の自動仕組み化
shiki_kakaku
0
1.9k
AIと壁打ちしながら進めるコスト管理
fufuhu
0
970
夏だ!祭りだ!祭りとはドメインモデリングでは?
ryugen04
0
340
freee が目指す データ マネジメント戦略 AI-Ready 時代を支える 攻めのガバナンスとは
freee
PRO
0
440
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
210
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
500
Android CLI
fornewid
0
230
<title><a id="</title>君はこのHTMLをパースできるか"></a></title> #雑LT_study
pizzacat83
0
160
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
340
Featured
See All Featured
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
620
Facilitating Awesome Meetings
lara
57
7.1k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
260
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
260
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
370
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
10k
Mind Mapping
helmedeiros
PRO
1
320
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Code Reviewing Like a Champion
maltzj
528
40k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
420
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Transcript
Safe Navigation in Ruby 2.3
Safe Navigation > some_array.first.positive? > [].first.positive? (value = some_array.first) &&
value.positive? > some_array.first&.positive? # => true # => NoMethodError: undefined method `positive?' for nil:NilClass # => nil
Safe Navigation if user.account && user.account.trial? # process trial account
settings end if user.account&.trial? # process trial account settings end if user.account && user.account != previous_account # setup new account end if user.account &.!= previous_account # setup new account end &.&, &.<<, and &.+