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
59
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
120
Agile Design
rickliu
0
76
Active Job in Rails 4.2
rickliu
0
55
Other Decks in Programming
See All in Programming
既存デザインを変更せずにタップ領域を広げる方法
tahia910
1
240
今ならAmazon ECSのサービス間通信をどう選ぶか / Selection of ECS Interservice Communication 2025
tkikuc
11
2.5k
AWS CDKの推しポイント 〜CloudFormationと比較してみた〜
akihisaikeda
3
280
C++20 射影変換
faithandbrave
0
500
Perplexity Slack Botを作ってAI活用を進めた話 / AI Engineering Summit プレイベント
n3xem
0
670
FormFlow - Build Stunning Multistep Forms
yceruto
1
180
Passkeys for Java Developers
ynojima
3
870
機械学習って何? 5分で解説頑張ってみる
kuroneko2828
0
220
GraphRAGの仕組みまるわかり
tosuri13
7
440
型付きアクターモデルがもたらす分散シミュレーションの未来
piyo7
0
800
Create a website using Spatial Web
akkeylab
0
290
Development of an App for Intuitive AI Learning - Blockly Summit 2025
teba_eleven
0
120
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2.1k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
137
34k
Producing Creativity
orderedlist
PRO
346
40k
Documentation Writing (for coders)
carmenintech
71
4.9k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Being A Developer After 40
akosma
90
590k
The Straight Up "How To Draw Better" Workshop
denniskardys
233
140k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
34
3k
Making the Leap to Tech Lead
cromwellryan
134
9.3k
Testing 201, or: Great Expectations
jmmastey
42
7.5k
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 &.+