Sha256: cfb37157d4c744b46d911af71959943517a81fb29a6e8b6eef656cb05b9d9cca

Contents?: true

Size: 390 Bytes

Versions: 11

Compression:

Stored size: 390 Bytes

Contents

# frozen_string_literal: true

module Kind
  module Maybe::Methods
    def Maybe(&block)
      Kind::Maybe.from(&block)
    end

    def None
      Kind::Maybe::NONE_INSTANCE
    end

    def Some(value = UNDEFINED, &block)
      UNDEFINED == value && block ? Maybe(&block) : Kind::Maybe[value]
    end

    def self.included(base)
      base.send(:private, :Some, :None)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
kind-5.10.0 lib/kind/maybe/methods.rb
kind-5.9.0 lib/kind/maybe/methods.rb
kind-5.8.1 lib/kind/maybe/methods.rb
kind-5.8.0 lib/kind/maybe/methods.rb
kind-5.7.0 lib/kind/maybe/methods.rb
kind-5.6.0 lib/kind/maybe/methods.rb
kind-5.5.0 lib/kind/maybe/methods.rb
kind-5.4.1 lib/kind/maybe/methods.rb
kind-5.4.0 lib/kind/maybe/methods.rb
kind-5.3.0 lib/kind/maybe/methods.rb
kind-5.2.0 lib/kind/maybe/methods.rb