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
72
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
82
Active Job in Rails 4.2
rickliu
0
65
Other Decks in Programming
See All in Programming
광주소프트웨어마이스터고등학교 DevFest 특강 - 바이브 코딩 시대에서 주니어 개발자로 살아남는 방법
utilforever
1
160
ソフトウェア設計に溶けるインフラ ― AWS CDK のインフラ認識論
konokenj
3
710
torikago - Ruby::Boxで照らすモジュラモノリスの実行境界
se4weed
1
280
ITヒヤリハットを整理してみた ~ライフサイクルと原因から考える再発防止策~
koukimiura
1
120
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
190
メールのエイリアス機能を履き違えない
isshinfunada
0
160
Laravel Boostに学ぶ、AIにPHPを書かせる技術 〜OSSの実装から蒸留するエージェント制御の王道〜
kentaroutakeda
3
580
複数の Claude Code が"放置"されてしまう問題をCLI ダッシュボードを自作して解決した話
sumihiro3
0
570
Embedded SREと共に達成した会員管理システムのAWS移行 - SRE NEXT 2026 ランチスポンサーセッション
niftycorp
PRO
1
3.2k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
460
React本体のコードリーディング
high_g_engineer
0
120
Claude Team Plan導入・ガイド
tk3fftk
0
240
Featured
See All Featured
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.5k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
240
We Have a Design System, Now What?
morganepeng
55
8.2k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
280
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.5k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
41k
The Cult of Friendly URLs
andyhume
79
7k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
670
Speed Design
sergeychernyshev
33
2k
The Spectacular Lies of Maps
axbom
PRO
1
880
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
500
Everyday Curiosity
cassininazir
0
270
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 &.+