Sha256: 075a0e1a2843040a20f31af9fb54c5ef2711fbe9738fa85486dd1a6355c96b77
Contents?: true
Size: 684 Bytes
Versions: 6
Compression:
Stored size: 684 Bytes
Contents
# frozen_string_literal: true require 'dry/effects/effect' require 'dry/effects/constructors' module Dry module Effects module Effects class Retry < ::Module class Retry < Effect include ::Dry::Equalizer(:type, :name, :payload, :scope) option :scope end Constructors.register(:Retry) do |scope| Retry.new(type: :retry, scope: scope) end def initialize module_eval do define_method(:repeat) do |scope| effect = Retry.new(type: :retry, scope: scope) ::Dry::Effects.yield(effect) end end end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems