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
Rick Liu
January 22, 2016
Programming
68
0
Share
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
220
You Don't Need a JavaScript Framework
rickliu
0
130
Agile Design
rickliu
0
80
Active Job in Rails 4.2
rickliu
0
61
Other Decks in Programming
See All in Programming
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
180
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
170
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
320
L’IA au service des devs : Anatomie d'un assistant de Code Review
toham
0
220
YJITとZJITにはイカなる違いがあるのか?
nakiym
0
200
forteeの改修から振り返るPHPerKaigi 2026
muno92
PRO
3
270
感情を設計する
ichimichi
5
1.4k
Go_College_最終発表資料__外部公開用_.pdf
xe_pc23
0
180
Make GenAI Production-Ready with Kubernetes Patterns
bibryam
0
110
KagglerがMixSeekを触ってみた
morim
0
370
テレメトリーシグナルが導くパフォーマンス最適化 / Performance Optimization Driven by Telemetry Signals
seike460
PRO
2
220
へんな働き方
yusukebe
6
2.9k
Featured
See All Featured
Accessibility Awareness
sabderemane
0
97
Git: the NoSQL Database
bkeepers
PRO
432
67k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
370
Odyssey Design
rkendrick25
PRO
2
570
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
The Cult of Friendly URLs
andyhume
79
6.8k
Designing Powerful Visuals for Engaging Learning
tmiket
1
330
Being A Developer After 40
akosma
91
590k
Testing 201, or: Great Expectations
jmmastey
46
8.1k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.1k
Between Models and Reality
mayunak
3
260
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 &.+