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
62
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
78
Active Job in Rails 4.2
rickliu
0
57
Other Decks in Programming
See All in Programming
Grafana:建立系統全知視角的捷徑
blueswen
0
330
CSC307 Lecture 01
javiergs
PRO
0
690
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
5
440
Data-Centric Kaggle
isax1015
2
770
SourceGeneratorのススメ
htkym
0
190
Architectural Extensions
denyspoltorak
0
280
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6k
CSC307 Lecture 02
javiergs
PRO
1
780
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
170
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
460
Fragmented Architectures
denyspoltorak
0
150
Implementation Patterns
denyspoltorak
0
280
Featured
See All Featured
My Coaching Mixtape
mlcsv
0
48
Raft: Consensus for Rubyists
vanstee
141
7.3k
How to make the Groovebox
asonas
2
1.9k
Agile that works and the tools we love
rasmusluckow
331
21k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
110
Rails Girls Zürich Keynote
gr2m
96
14k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.1k
Designing Experiences People Love
moore
144
24k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.9k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Skip the Path - Find Your Career Trail
mkilby
0
54
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 &.+