-1

Possible Duplicate:
What does ||= mean in Ruby?

what is ||= in ruby?

Community
  • 1
  • 1
Blankman
  • 259,732
  • 324
  • 769
  • 1,199

1 Answers1

0

It's a conditional assignment. If the variable is nil or false it will be replaced with the value on the right hand side; if it already has a value other than nil or false it will keep that value.

Russ Cam
  • 124,184
  • 33
  • 204
  • 266