Sha256: 586bd6a090fd04a9f320af64093290f5774694e4a5aec56553772480fde31cef

Contents?: true

Size: 670 Bytes

Versions: 12

Compression:

Stored size: 670 Bytes

Contents

module Dry
  module Monads
    module ConversionStubs
      def self.[](*method_names)
        Module.new do
          method_names.each do |name|
            define_method(name) do |*|
              Methods.public_send(name)
            end
          end
        end
      end

      module Methods
        module_function

        def to_maybe
          raise "Load Maybe first with require 'dry/monads/maybe'"
        end

        def to_result
          raise "Load Result first with require 'dry/monads/result'"
        end

        def to_validated
          raise "Load Validated first with require 'dry/monads/validated'"
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
dry-monads-1.3.4 lib/dry/monads/conversion_stubs.rb
dry-monads-1.3.3 lib/dry/monads/conversion_stubs.rb
dry-monads-1.3.2 lib/dry/monads/conversion_stubs.rb
dry-monads-1.3.1 lib/dry/monads/conversion_stubs.rb
dry-monads-1.3.0 lib/dry/monads/conversion_stubs.rb
dry-monads-1.2.0 lib/dry/monads/conversion_stubs.rb
dry-monads-1.1.0 lib/dry/monads/conversion_stubs.rb
dry-monads-1.0.1 lib/dry/monads/conversion_stubs.rb
dry-monads-1.0.0 lib/dry/monads/conversion_stubs.rb
dry-monads-1.0.0.rc1 lib/dry/monads/conversion_stubs.rb
dry-monads-1.0.0.beta3 lib/dry/monads/conversion_stubs.rb
dry-monads-1.0.0.beta2 lib/dry/monads/conversion_stubs.rb