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
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
bootcamp2025_バックエンド研修_WebAPIサーバ作成.pdf
geniee_inc
0
110
10年もののAPIサーバーにおけるCI/CDの改善の奮闘
mbook
0
830
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
110
Catch Up: Go Style Guide Update
andpad
0
230
Web フロントエンドエンジニアに開かれる AI Agent プロダクト開発 - Vercel AI SDK を観察して AI Agent と仲良くなろう! #FEC余熱NIGHT
izumin5210
3
530
『毎日の移動』を支えるGoバックエンド内製開発
yutautsugi
2
250
株式会社 Sun terras カンパニーデック
sunterras
0
310
Web Components で実現する Hotwire とフロントエンドフレームワークの橋渡し / Bridging with Web Components
da1chi
3
2.5k
チームの境界をブチ抜いていけ
tokai235
0
180
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
200
Advance Your Career with Open Source
ivargrimstad
0
540
TFLintカスタムプラグインで始める Terraformコード品質管理
bells17
2
170
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.2k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
1.6k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Build your cross-platform service in a week with App Engine
jlugia
232
18k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Reflections from 52 weeks, 52 projects
jeffersonlam
353
21k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
How to Think Like a Performance Engineer
csswizardry
27
2k
GitHub's CSS Performance
jonrohan
1032
470k
Building Better People: How to give real-time feedback that sticks.
wjessup
369
20k
What's in a price? How to price your products and services
michaelherold
246
12k
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 &.+