Sha256: 98c09232785b37019cb6dcd6da7ad23d7f48a2bb621c8c0bb49990d2ffcce901

Contents?: true

Size: 576 Bytes

Versions: 8

Compression:

Stored size: 576 Bytes

Contents

# frozen_string_literal: true

# @api private
# @since 0.1.0
class SmartCore::Types::Primitive::SumChecker
  # @param [Array<SmartCore::Types::Primitive::Checker>]
  # @return [void]
  #
  # @api private
  # @since 0.1.0
  def initialize(*checkers)
    @checkers = checkers
  end

  # @param value [Any]
  # @return [Boolean]
  #
  # @api private
  # @since 0.1.0
  def call(value)
    checkers.any? { |checker| checker.call(value) }
  end

  private

  # @return [Array<SmartCore::Types::Primitive::Checker>]
  #
  # @api private
  # @since 0.1.0
  attr_reader :checkers
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
smart_types-0.1.0 lib/smart_core/types/primitive/sum_checker.rb
smart_types-0.1.0.alpha6 lib/smart_core/types/primitive/sum_checker.rb
smart_types-0.1.0.alpha5 lib/smart_core/types/primitive/sum_checker.rb
smart_types-0.1.0.alpha4 lib/smart_core/types/primitive/sum_checker.rb
smart_types-0.1.0.alpha3 lib/smart_core/types/primitive/sum_checker.rb
smart_types-0.1.0.alpha2 lib/smart_core/types/primitive/sum_checker.rb
smart_types-0.1.0.alpha lib/smart_core/types/primitive/sum_checker.rb
smart_types-0.0.0 lib/smart_core/types/primitive/sum_checker.rb