$30 off During Our Annual Pro Sale. View Details »
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
60
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
77
Active Job in Rails 4.2
rickliu
0
56
Other Decks in Programming
See All in Programming
配送計画の均等化機能を提供する取り組みについて(⽩⾦鉱業 Meetup Vol.21@六本⽊(数理最適化編))
izu_nori
0
150
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
8
2.4k
Why Kotlin? 電子カルテを Kotlin で開発する理由 / Why Kotlin? at Henry
agatan
2
7.2k
從冷知識到漏洞,你不懂的 Web,駭客懂 - Huli @ WebConf Taiwan 2025
aszx87410
2
2.6k
Rediscover the Console - SymfonyCon Amsterdam 2025
chalasr
2
160
ハイパーメディア駆動アプリケーションとIslandアーキテクチャ: htmxによるWebアプリケーション開発と動的UIの局所的適用
nowaki28
0
420
手が足りない!兼業データエンジニアに必要だったアーキテクチャと立ち回り
zinkosuke
0
700
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
410
ViewファーストなRailsアプリ開発のたのしさ
sugiwe
0
470
Microservices rules: What good looks like
cer
PRO
0
1.4k
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
3
740
TestingOsaka6_Ozono
o3
0
160
Featured
See All Featured
Building Applications with DynamoDB
mza
96
6.8k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
196
70k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Building Adaptive Systems
keathley
44
2.9k
Automating Front-end Workflow
addyosmani
1371
200k
GraphQLの誤解/rethinking-graphql
sonatard
73
11k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
970
A Modern Web Designer's Workflow
chriscoyier
698
190k
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 &.+