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
54
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
210
You Don't Need a JavaScript Framework
rickliu
0
110
Agile Design
rickliu
0
65
Active Job in Rails 4.2
rickliu
0
41
Other Decks in Programming
See All in Programming
Amazon SQSコンシューマー疎結合への旅 - 出張! #DevelopersIO IT技術ブログの中の人が語る勉強会 #3
quiver
0
270
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
210
Ruby GitHub Packages
bkuhlmann
0
630
educure_カリキュラム生操作マニュアル.pdf
linew_official
0
790
エンターテイメント業界で利用されるAWS
demuyan
0
210
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
130
Elm Form Validation
bkuhlmann
0
510
使ってみよう Azure AI Document Intelligence
kosmosebi
2
310
dbtのドメイン分割による データ基盤の改善とDigdagとの連携
sakama
0
330
Elm 0.19.0 Changes
bkuhlmann
0
490
コーンフレークから始める モデリング会話入門
ogurotakayuki
0
370
初心者のためのRubyKaigi入門/RubyKaigi Introduction
a_matsuda
0
460
Featured
See All Featured
The Brand Is Dead. Long Live the Brand.
mthomps
49
29k
The Cost Of JavaScript in 2023
addyosmani
16
3.9k
In The Pink: A Labor of Love
frogandcode
138
21k
Atom: Resistance is Futile
akmur
259
25k
Happy Clients
brianwarren
92
6.4k
Debugging Ruby Performance
tmm1
70
11k
GraphQLの誤解/rethinking-graphql
sonatard
50
9.2k
Pencils Down: Stop Designing & Start Developing
hursman
117
11k
Optimising Largest Contentful Paint
csswizardry
8
2.4k
Designing the Hi-DPI Web
ddemaree
276
33k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
121
39k
Fashionably flexible responsive web design (full day workshop)
malarkey
398
65k
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 &.+