lib/totally_lazy/option.rb in totally_lazy-0.1.23 vs lib/totally_lazy/option.rb in totally_lazy-0.1.24
- old
+ new
@@ -107,10 +107,14 @@
get
end
alias or_else get_or_else
+ def get_or_nil
+ get
+ end
+
def enumerator
Enumerator.new { |y|
y << @value
raise StopIteration.new
}
@@ -174,9 +178,13 @@
value_or_fn
end
end
alias or_else get_or_else
+
+ def get_or_nil
+ nil
+ end
def enumerator
Enumerator.new { |y|
raise StopIteration.new
}