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
0
59
Safe Navigation in Ruby 2.3
Introduction the new operator and its problem.
Rick Liu
January 22, 2016
Tweet
Share
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
120
Agile Design
rickliu
0
76
Active Job in Rails 4.2
rickliu
0
55
Other Decks in Programming
See All in Programming
抽象化という思考のツール - 理解と活用 - / Abstraction-as-a-Tool-for-Thinking
shin1x1
1
960
Comparing decimals in Swift Testing
417_72ki
0
170
Portapad紹介プレゼンテーション
gotoumakakeru
1
120
『リコリス・リコイル』に学ぶ!! 〜キャリア戦略における計画的偶発性理論と変わる勇気の重要性〜
wanko_it
1
460
Vibe Codingの幻想を超えて-生成AIを現場で使えるようにするまでの泥臭い話.ai
fumiyakume
21
10k
Flutterと Vibe Coding で個人開発!
hyshu
1
250
Vibe coding コードレビュー
kinopeee
0
430
パスタの技術
yusukebe
1
200
管你要 trace 什麼、bpftrace 用下去就對了 — COSCUP 2025
shunghsiyu
0
380
バイブスあるコーディングで ~PHP~ 便利ツールをつくるプラクティス
uzulla
1
330
自作OSでDOOMを動かしてみた
zakki0925224
1
1.3k
あなたとJIT, 今すぐアセンブ ル
sisshiki1969
1
600
Featured
See All Featured
Faster Mobile Websites
deanohume
308
31k
Designing Experiences People Love
moore
142
24k
Making the Leap to Tech Lead
cromwellryan
134
9.5k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
The Straight Up "How To Draw Better" Workshop
denniskardys
235
140k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Raft: Consensus for Rubyists
vanstee
140
7.1k
RailsConf 2023
tenderlove
30
1.2k
It's Worth the Effort
3n
185
28k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1.1k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
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 &.+