What is the conditional assignment operator in Ruby on Rails (||=)
railsforfounders.substack.com
Conditional assignment operator is one of those things that you don't need to know as a beginner but you'll see being used commonly in open source code. This article provides a quick intro to it. Take a look at the method below. def doorkeeper_token @doorkeeper_token ||= OAuth::Token.authenticate( request, *Doorkeeper.config.access_token_methods, ) end
What is the conditional assignment operator in Ruby on Rails (||=)
What is the conditional assignment operator…
What is the conditional assignment operator in Ruby on Rails (||=)
Conditional assignment operator is one of those things that you don't need to know as a beginner but you'll see being used commonly in open source code. This article provides a quick intro to it. Take a look at the method below. def doorkeeper_token @doorkeeper_token ||= OAuth::Token.authenticate( request, *Doorkeeper.config.access_token_methods, ) end