Sha256: 7294bacb30f276814cd700b67b2337ba6134250928eeef4cd7c937be43c2e40b
Contents?: true
Size: 576 Bytes
Versions: 6
Compression:
Stored size: 576 Bytes
Contents
# frozen_string_literal: true require 'dry/effects/effect' require 'dry/effects/constructors' module Dry module Effects module Effects class Resolve < ::Module Resolve = Effect.new(type: :resolve) Constructors.register(:Resolve) { |key| Resolve.(key) } def initialize(*keys, **aliases) module_eval do (keys.zip(keys) + aliases.to_a).each do |name, key| define_method(name) { |&block| ::Dry::Effects.yield(Resolve.(key), &block) } end end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems