Sha256: 217b1ab383ac807fdb2c32c71927afb2a691fb63bbcd263d8106d5e8ad1dd0c2

Contents?: true

Size: 598 Bytes

Versions: 1

Compression:

Stored size: 598 Bytes

Contents

# frozen_string_literal: true

# @api private
# @since 0.1.0
class SmartCore::Types::Primitive::SumFactory::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/sum_factory/definition_context.rb