lib/zx/maybe.rb in zx-monads-0.0.4 vs lib/zx/maybe.rb in zx-monads-0.0.5

- old
+ new

@@ -1,21 +1,22 @@ # frozen_string_literal: true + module Zx module Maybe module Maybeable None = ->(*kwargs) { ::Maybe::None.new(*kwargs) } Some = ->(*kwargs) { ::Maybe::Some.new(*kwargs) } Maybe = ->(*kwargs) { ::Maybe.of(*kwargs) } - + def Maybe(*kwargs) ::Maybe.of(*kwargs) end - + def Some(*kwargs) ::Maybe::Some.new(*kwargs) end - + def None(*kwargs) ::Maybe::None.new(*kwargs) end def Try(default = nil, options = {}) @@ -28,6 +29,6 @@ def self.included(klass) klass.include(Maybeable) klass.extend(Maybeable) end end -end \ No newline at end of file +end