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
空間オーディオの活用
objectiveaudio
0
120
Spec-Driven Development with AI Agents (Workshop, May 2026)
antonarhipov
2
290
Programming with a DJ Controller — not vibe coding
m_seki
3
750
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
1k
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
27
18k
クラウドネイティブなエンジニアに向ける Raycastの魅力と実際の活用事例
nealle
2
230
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
160
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
320
実践CRDT
tamadeveloper
0
610
HTML-Aware ERB: The Path to Reactive Rendering @ RubyKaigi 2026, Hakodate, Japan
marcoroth
0
620
Import assertionsが消えた日~ECMAScriptの仕様はどう決まり、なぜ覆るのか~
bicstone
2
170
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
2.3k
Featured
See All Featured
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
180
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.2k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.4k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
190
Game over? The fight for quality and originality in the time of robots
wayneb77
1
170
Building the Perfect Custom Keyboard
takai
2
740
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
170
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
220
AI Search: Where Are We & What Can We Do About It?
aleyda
0
7.4k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
The World Runs on Bad Software
bkeepers
PRO
72
12k
So, you think you're a good person
axbom
PRO
2
2k
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 &.+