Class: SmartCore::Initializer::TypeSystem::ThyTypes::AbstractFactory Private
- Inherits:
-
Interop::AbstractFactory
- Object
- Interop::AbstractFactory
- SmartCore::Initializer::TypeSystem::ThyTypes::AbstractFactory
- Defined in:
- lib/smart_core/initializer/plugins/thy_types/thy_types/abstract_factory.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.
Constant Summary collapse
- GENERIC_TYPE =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
::Thy::Type.new { true }
Class Method Summary collapse
- .build_cast_operation(type) ⇒ SmartCore::Initializer::TypeSystem::ThyTypes::Operation::Cast private
- .build_identifier(type) ⇒ String private
- .build_interop(identifier, valid_op, validate_op, cast_op) ⇒ SmartCore::Initializer::TypeSystem::ThyTypes private
- .build_valid_operation(type) ⇒ SmartCore::Initializer::TypeSystem::ThyTypes::Operation::Valid private
- .build_validate_operation(type) ⇒ SmartCore::Initializer::TypeSystem::ThyTypes::Operation::Validate private
- .generic_type_object ⇒ Thy::Type, #check private
- .prevent_incompatible_type!(type) ⇒ void private
Methods inherited from Interop::AbstractFactory
Class Method Details
.build_cast_operation(type) ⇒ SmartCore::Initializer::TypeSystem::ThyTypes::Operation::Cast
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.
71 72 73 |
# File 'lib/smart_core/initializer/plugins/thy_types/thy_types/abstract_factory.rb', line 71 def build_cast_operation(type) ThyTypes::Operation::Cast.new(type) end |
.build_identifier(type) ⇒ String
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.
36 37 38 |
# File 'lib/smart_core/initializer/plugins/thy_types/thy_types/abstract_factory.rb', line 36 def build_identifier(type) type.name end |
.build_interop(identifier, valid_op, validate_op, cast_op) ⇒ SmartCore::Initializer::TypeSystem::ThyTypes
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.
84 85 86 |
# File 'lib/smart_core/initializer/plugins/thy_types/thy_types/abstract_factory.rb', line 84 def build_interop(identifier, valid_op, validate_op, cast_op) ThyTypes.new(identifier, valid_op, validate_op, cast_op) end |
.build_valid_operation(type) ⇒ SmartCore::Initializer::TypeSystem::ThyTypes::Operation::Valid
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.
45 46 47 |
# File 'lib/smart_core/initializer/plugins/thy_types/thy_types/abstract_factory.rb', line 45 def build_valid_operation(type) ThyTypes::Operation::Valid.new(type) end |
.build_validate_operation(type) ⇒ SmartCore::Initializer::TypeSystem::ThyTypes::Operation::Validate
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.
62 63 64 |
# File 'lib/smart_core/initializer/plugins/thy_types/thy_types/abstract_factory.rb', line 62 def build_validate_operation(type) ThyTypes::Operation::Validate.new(type) end |
.generic_type_object ⇒ Thy::Type, #check
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.
53 54 55 |
# File 'lib/smart_core/initializer/plugins/thy_types/thy_types/abstract_factory.rb', line 53 def generic_type_object GENERIC_TYPE end |
.prevent_incompatible_type!(type) ⇒ void
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.
This method returns an undefined value.
21 22 23 24 25 26 27 28 29 |
# File 'lib/smart_core/initializer/plugins/thy_types/thy_types/abstract_factory.rb', line 21 def prevent_incompatible_type!(type) unless type.respond_to?(:check) || type.is_a?(::Thy::Type) raise( SmartCore::Initializer::IncorrectTypeObjectError, 'Incorrect Thy::Type primitive ' \ '(type object should respond to :check method)' ) end end |