Sha256: a3dd799edf9ac0ed34dbdfcb07bab618122f621eccd3c3a6655cc52159a2146b

Contents?: true

Size: 490 Bytes

Versions: 9

Compression:

Stored size: 490 Bytes

Contents

# frozen_string_literal: true

# @api private
# @since 0.1.0
class SmartCore::Types::Primitive::Checker
  # @param expression [Proc]
  # @return [void]
  #
  # @api private
  # @since 0.1.0
  def initialize(expression)
    @expression = expression
  end

  # @param value [Any]
  # @return [Boolean]
  #
  # @api private
  # @since 0.1.0
  def call(value)
    !!expression.call(value)
  end

  private

  # @return [Proc]
  #
  # @api private
  # @since 0.1.0
  attr_reader :expression
end

Version data entries

9 entries across 9 versions & 1 rubygems

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