Sha256: 6f2a0a33bad7e80e0253652ca461634e28e14810967785b36c49f254acbaced8

Contents?: true

Size: 483 Bytes

Versions: 9

Compression:

Stored size: 483 Bytes

Contents

# frozen_string_literal: true

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

  # @param value [Any]
  # @return [Any]
  #
  # @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/caster.rb
smart_types-0.1.0 lib/smart_core/types/primitive/caster.rb
smart_types-0.1.0.alpha6 lib/smart_core/types/primitive/caster.rb
smart_types-0.1.0.alpha5 lib/smart_core/types/primitive/caster.rb
smart_types-0.1.0.alpha4 lib/smart_core/types/primitive/caster.rb
smart_types-0.1.0.alpha3 lib/smart_core/types/primitive/caster.rb
smart_types-0.1.0.alpha2 lib/smart_core/types/primitive/caster.rb
smart_types-0.1.0.alpha lib/smart_core/types/primitive/caster.rb
smart_types-0.0.0 lib/smart_core/types/primitive/caster.rb