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
74
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
More Decks by Rick Liu
See All by Rick Liu
Functional Programming Concepts
rickliu
0
230
You Don't Need a JavaScript Framework
rickliu
0
130
Agile Design
rickliu
0
85
Active Job in Rails 4.2
rickliu
0
65
Other Decks in Programming
See All in Programming
AI Readyの正体はデータマネジメントだ メダリオン2.0の最前線
freee
PRO
0
330
「人を評価する AI」の設計と実装
ryoyanara
0
220
Claude CodeとAgentCore Gatewayを繋ぐ際の認証認可 / Authentication and authorization when connecting Claude Code with AgentCore Gateway
har1101
2
340
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
350
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
190
AIを紡ぐPMのお話
swdtkuy
0
120
バグを直したら useEffect が消えた
colorful12
3
660
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
220
Pythonの実行はどこまで賢くなったのか? CPythonとPyPyから見る最適化のしくみ
curekoshimizu
0
180
変わらないものが、変わるものを決める — 意図駆動開発 × イベントソーシング × イミュータブル | What Doesn't Change Decides What Can — IDD × Event Sourcing × Immutability
tomohisa
0
1.8k
Android CLI
fornewid
0
230
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
4
490
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
Bash Introduction
62gerente
615
220k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
170
Music & Morning Musume
bryan
47
7.3k
Technical Leadership for Architectural Decision Making
baasie
3
510
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
260
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
370
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
210
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
290
Embracing the Ebb and Flow
colly
88
5.1k
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 &.+