0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

概要

Ruby on Railsを勉強していて
あまり見かけない演算子が出てきたので
メモとして残しておきます。

.ruby
user && user.authenticate(params[:session][:password])

のような論理値(boolean値)の条件式を

.ruby
user&.authenticate(params[:session][:password])

という風に短縮して記述できる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?