Class: SmartCore::Types::Primitive::MultFactory::DefinitionContext Private

Inherits:
Object
  • Object
show all
Defined in:
lib/smart_core/types/primitive/mult_factory/definition_context.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

Version:

  • 0.3.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializevoid

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.1.0

Version:

  • 0.3.0



24
25
26
27
# File 'lib/smart_core/types/primitive/mult_factory/definition_context.rb', line 24

def initialize
  @type_caster = nil
  @type_runtime_attributes_checker = nil
end

Instance Attribute Details

#type_casterProc, NilClass (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Proc, NilClass)

Since:

  • 0.1.0



11
12
13
# File 'lib/smart_core/types/primitive/mult_factory/definition_context.rb', line 11

def type_caster
  @type_caster
end

#type_runtime_attributes_checkerProc, NilClass (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Proc, NilClass)

Since:

  • 0.3.0



17
18
19
# File 'lib/smart_core/types/primitive/mult_factory/definition_context.rb', line 17

def type_runtime_attributes_checker
  @type_runtime_attributes_checker
end

Instance Method Details

#define_caster(&caster) ⇒ void

This method returns an undefined value.

Parameters:

  • caster (Block)

Raises:

Since:

  • 0.1.0

Version:

  • 0.3.0



35
36
37
38
# File 'lib/smart_core/types/primitive/mult_factory/definition_context.rb', line 35

def define_caster(&caster)
  raise(SmartCore::Types::TypeDefinitionError, 'No caster definition block') unless block_given?
  @type_caster = caster
end

#runtime_attributes_checker(&definition) ⇒ void

This method returns an undefined value.

Parameters:

  • definition (Block)

Since:

  • 0.3.0



45
46
47
48
49
50
# File 'lib/smart_core/types/primitive/mult_factory/definition_context.rb', line 45

def runtime_attributes_checker(&definition)
  unless block_given?
    raise(SmartCore::Types::TypeDefinitionError, 'No runtime checker definition block')
  end
  @type_runtime_attributes_checker = definition
end