Sha256: 9490073b539ae42cb9b31cabe5924297591879db86ff2fad5374b3fe8c44327e

Contents?: true

Size: 1.12 KB

Versions: 8

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

module ConvenientService
  module Common
    module Plugins
      module CanUtilizeFiniteLoop
        module Concern
          include Support::Concern

          instance_methods do
            private

            ##
            # @param max_iteration_count [Integer]
            # @param default [Object] Can be any type.
            # @param raise_on_exceedance [Boolean]
            # @param block [Proc]
            # @return [Object] Can be any type.
            #
            def finite_loop(
              max_iteration_count: Constants::MAX_ITERATION_COUNT,
              default: Constants::FINITE_LOOP_EXCEEDED,
              raise_on_exceedance: false,
              &block
            )
              Support::FiniteLoop.finite_loop(max_iteration_count: max_iteration_count, default: default, raise_on_exceedance: raise_on_exceedance, &block)
            end

            ##
            # @return [ConvenientService::Support::UniqueValue]
            #
            def finite_loop_exceeded
              Constants::FINITE_LOOP_EXCEEDED
            end
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
convenient_service-0.19.1 lib/convenient_service/common/plugins/can_utilize_finite_loop/concern.rb
convenient_service-0.19.0 lib/convenient_service/common/plugins/can_utilize_finite_loop/concern.rb
convenient_service-0.18.0 lib/convenient_service/common/plugins/can_utilize_finite_loop/concern.rb
convenient_service-0.17.0 lib/convenient_service/common/plugins/can_utilize_finite_loop/concern.rb
convenient_service-0.16.0 lib/convenient_service/common/plugins/can_utilize_finite_loop/concern.rb
convenient_service-0.15.0 lib/convenient_service/common/plugins/can_utilize_finite_loop/concern.rb
convenient_service-0.14.0 lib/convenient_service/common/plugins/can_utilize_finite_loop/concern.rb
convenient_service-0.13.0 lib/convenient_service/common/plugins/can_utilize_finite_loop/concern.rb