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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Rick Liu
January 22, 2016
Programming
0
62
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
130
Agile Design
rickliu
0
78
Active Job in Rails 4.2
rickliu
0
57
Other Decks in Programming
See All in Programming
QAフローを最適化し、品質水準を満たしながらリリースまでの期間を最短化する #RSGT2026
shibayu36
2
4.4k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
550
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
izumin5210のプロポーザルのネタ探し #tskaigi_msup
izumin5210
1
110
Grafana:建立系統全知視角的捷徑
blueswen
0
330
Package Management Learnings from Homebrew
mikemcquaid
0
220
高速開発のためのコード整理術
sutetotanuki
1
400
CSC307 Lecture 09
javiergs
PRO
1
830
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
560
360° Signals in Angular: Signal Forms with SignalStore & Resources @ngLondon 01/2026
manfredsteyer
PRO
0
120
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
260
AtCoder Conference 2025
shindannin
0
1.1k
Featured
See All Featured
Leo the Paperboy
mayatellez
4
1.4k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Ruling the World: When Life Gets Gamed
codingconduct
0
140
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
62
49k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
53
The Curse of the Amulet
leimatthew05
1
8.4k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
HDC tutorial
michielstock
1
370
Darren the Foodie - Storyboard
khoart
PRO
2
2.4k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
240
sira's awesome portfolio website redesign presentation
elsirapls
0
150
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 &.+