Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Safe Navigation in Ruby 2.3
Search
Rick Liu
January 22, 2016
Programming
79
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
Transcript
3 slides
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 &.+
More Decks by Rick Liu
See All by Rick Liu
Functional Programming Concepts
rickliu
0
250
You Don't Need a JavaScript Framework
rickliu
0
140
Agile Design
rickliu
0
90
Active Job in Rails 4.2
rickliu
0
70
Other Decks in Programming
See All in Programming
高速開発を止めずに 性能を上げる Flyleのシステム刷新と改善の歴史
azihsoyn
0
110
The Cost of the DOM
ypresto
4
1.6k
Crash Auto Pipelines
veronikapj
1
460
AIエージェントの「テストは通るのに本番で壊れる」を減らす
shibuiwilliam
3
130
自宅サーバはどこまで再現できるのか - Proxmox VE上のVM環境をIaCとバックアップで戻してみた
youto
0
450
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
210
眠らない開発チームの作り方
biwakonbu
0
170
LLM 101
dalinaum
0
560
正解の無い問題を 「できるだけ上手く」解く ヒューリスティックで感性を磨こう。〜現実課題をプログラミングで解きあうコミュニティについて〜
allegrogiken
0
120
あなたはMCPの機能を、まだ知らない。
4geru
1
750
Engineering Biometric UX Across Android Versions | DroidKnights 2026
ryunen344
1
220
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
17
9.6k
Featured
See All Featured
Claude Code のすすめ
schroneko
67
230k
Well, that’s weird…
csswizardry
3
260
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
370
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
The Invisible Side of Design
smashingmag
301
52k
The SEO Collaboration Effect
kristinabergwall1
1
630
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.6k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
680
Being A Developer After 40
akosma
PRO
92
590k
Side Projects
sachag
456
43k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.7k