lib/option.rb in option-0.3.0 vs lib/option.rb in option-0.3.1
- old
+ new
@@ -68,10 +68,15 @@
end
def filter(&blk)
exists?(&blk) ? self : None
end
+
+ def inside(&blk)
+ blk.call(get)
+ self
+ end
end
class NoneClass < OptionClass
def to_a
@@ -117,9 +122,13 @@
def exists?(&blk)
false
end
def filter(&blk)
+ self
+ end
+
+ def inside(&blk)
self
end
end
None = NoneClass.new