lib/dry/effects/effects/resolve.rb in dry-effects-0.2.0 vs lib/dry/effects/effects/resolve.rb in dry-effects-0.3.0
- old
+ new
@@ -11,15 +11,15 @@
VALID_NAME = /([a-z_][a-zA-Z_0-9]*)$/.freeze
Resolve = Effect.new(type: :resolve)
- Constructors.register(:Resolve) { |key| Resolve.(key) }
+ Constructors.register(:Resolve) { Resolve.(_1) }
def initialize(*keys, **aliases)
super()
- keys_aliased = keys.map { |k| name_for(k) }.zip(keys)
+ keys_aliased = keys.map { name_for(_1) }.zip(keys)
module_eval do
(keys_aliased + aliases.to_a).each do |name, key|
define_method(name) { |&block| ::Dry::Effects.yield(Resolve.(key), &block) }
end
end