Module: SmartCore::Types::Primitive::NilableFactory Private

Defined in:
lib/smart_core/types/primitive/nilable_factory.rb

Overview

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

Since:

  • 0.1.0

Version:

  • 0.3.0

Class Method Summary collapse

Class Method Details

.create_type(type) ⇒ SmartCore::Type::Primitive

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.

Parameters:

Returns:

  • (SmartCore::Type::Primitive)

Since:

  • 0.1.0

Version:

  • 0.2.0



14
15
16
17
18
19
20
# File 'lib/smart_core/types/primitive/nilable_factory.rb', line 14

def create_type(type)
  type_validator = build_type_validator(type)
  type_caster = build_type_caster(type)
  build_type(type, type_validator, type_caster).tap do |new_type|
    assign_type_validator(new_type, type_validator)
  end
end