-1

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

what is ||= in ruby?

Community
  • 1
  • 1
Blankman
  • 248,432
  • 309
  • 736
  • 1,161

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
  • 121,250
  • 30
  • 197
  • 258