Class: SmartCore::Initializer::TypeSystem::SmartTypes::AbstractFactory Private
- Inherits:
-
Interop::AbstractFactory
- Object
- Interop::AbstractFactory
- SmartCore::Initializer::TypeSystem::SmartTypes::AbstractFactory
- Defined in:
- lib/smart_core/initializer/type_system/smart_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.
Class Method Summary collapse
- .build_cast_operation(type) ⇒ SmartCore::Initializer::TypeSystem::SmartTypes::Operation::Cast private
- .build_identifier(type) ⇒ String private
- .build_interop(identifier, valid_op, validate_op, cast_op) ⇒ SmartCore::Initializer::TypeSystem::SmartTypes private
- .build_valid_operation(type) ⇒ SmartCore::Initializer::TypeSystem::SmartTypes::Operation::Valid private
- .build_validate_operation(type) ⇒ SmartCore::Initializer::TypeSystem::SmartTypes::Operation::Validate private
- .generic_type_object ⇒ SmartCore::Types::Value::Any private
- .prevent_incompatible_type!(type) ⇒ void private
Methods inherited from Interop::AbstractFactory
Class Method Details
.build_cast_operation(type) ⇒ SmartCore::Initializer::TypeSystem::SmartTypes::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.
65 66 67 |
# File 'lib/smart_core/initializer/type_system/smart_types/abstract_factory.rb', line 65 def build_cast_operation(type) SmartTypes::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.
30 31 32 |
# File 'lib/smart_core/initializer/type_system/smart_types/abstract_factory.rb', line 30 def build_identifier(type) type.name end |
.build_interop(identifier, valid_op, validate_op, cast_op) ⇒ SmartCore::Initializer::TypeSystem::SmartTypes
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.
78 79 80 |
# File 'lib/smart_core/initializer/type_system/smart_types/abstract_factory.rb', line 78 def build_interop(identifier, valid_op, validate_op, cast_op) SmartTypes.new(identifier, valid_op, validate_op, cast_op) end |
.build_valid_operation(type) ⇒ SmartCore::Initializer::TypeSystem::SmartTypes::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.
39 40 41 |
# File 'lib/smart_core/initializer/type_system/smart_types/abstract_factory.rb', line 39 def build_valid_operation(type) SmartTypes::Operation::Valid.new(type) end |
.build_validate_operation(type) ⇒ SmartCore::Initializer::TypeSystem::SmartTypes::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.
56 57 58 |
# File 'lib/smart_core/initializer/type_system/smart_types/abstract_factory.rb', line 56 def build_validate_operation(type) SmartTypes::Operation::Validate.new(type) end |
.generic_type_object ⇒ SmartCore::Types::Value::Any
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.
47 48 49 |
# File 'lib/smart_core/initializer/type_system/smart_types/abstract_factory.rb', line 47 def generic_type_object SmartCore::Types::Value::Any 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.
15 16 17 18 19 20 21 22 23 |
# File 'lib/smart_core/initializer/type_system/smart_types/abstract_factory.rb', line 15 def prevent_incompatible_type!(type) unless type.is_a?(SmartCore::Types::Primitive) raise( SmartCore::Initializer::IncorrectTypeObjectError, 'Incorrect SmartCore::Types primitive ' \ '(type object should be a type of SmartCore::Types::Primitive)' ) end end |