Sha256: e0ca0c20fff521f1d8789b80f2889781c9d2b38feb37b38a6d367ad4689083ae

Contents?: true

Size: 599 Bytes

Versions: 1

Compression:

Stored size: 599 Bytes

Contents

# frozen_string_literal: true

# @api private
# @since 0.1.0
class SmartCore::Types::Primitive::MultFactory::DefinitionContext
  # @return [Proc, NilClass]
  #
  # @api private
  # @since 0.1.0
  attr_reader :type_caster

  # @return [void]
  #
  # @api private
  # @since 0.1.0
  def initialize
    @type_caster = nil
  end

  # @param caster [Block]
  # @return [void]
  #
  # @api public
  # @since 0.1.0
  def define_caster(&caster)
    raise(SmartCore::Types::ArgumentError, 'No caster definition block') unless block_given?
    @type_caster = caster
  end

  # TODO (0.x.0): invariant API
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
smart_types-0.2.0 lib/smart_core/types/primitive/mult_factory/definition_context.rb