Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a ruby equivalent to the Scala Option?

How do I model an optional value in ruby? Scala has Option[], which is what I'm looking for in ruby.

like image 749
ladrl Avatar asked Jun 22 '11 06:06

ladrl


1 Answers

There's no equivalent in the standard library. You have to define your own. See this article.

like image 69
missingfaktor Avatar answered Oct 19 '22 23:10

missingfaktor