Module: SmartCore::Initializer

Included in:
Operation
Defined in:
lib/smart_core/initializer.rb,
lib/smart_core/initializer/exceptions.rb,
lib/smart_core/initializer/initialization_dsl.rb

Overview

Since:

  • 0.5.0

Defined Under Namespace

Modules: InitializationDSL, InstanceAttributeAccessing Classes: Attribute, AttributeDefiner, AttributeSet, Extension, ExtensionDefiner, ExtensionSet, InstanceBuilder, Type, TypeSet

Constant Summary collapse

Error =

Since:

  • 0.5.0

Class.new(SmartCore::Error)
ArgumentError =

Since:

  • 0.5.0

Class.new(SmartCore::ArgumentError)
IncompatibleFinalizerTypeError =

Since:

  • 0.5.0

Class.new(ArgumentError)
ParameterError =

Since:

  • 0.5.0

Class.new(ArgumentError)
ParamOverlapError =

Since:

  • 0.5.0

Class.new(ParameterError)
OptionError =

Since:

  • 0.5.0

Class.new(ArgumentError)
OptionOverlapError =

Since:

  • 0.5.0

Class.new(OptionError)
IncorrectAttributeNameError =

Since:

  • 0.5.0

Class.new(Error)
UnregisteredTypeError =

Since:

  • 0.5.0

Class.new(Error)
UnsupportedAttributePrivacyError =

Since:

  • 0.5.0

Class.new(Error)
TypeError =

Since:

  • 0.5.0

Class.new(ArgumentError)

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.get_type(name) ⇒ SmartCore::Initializer::Type

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:

  • name (String, Symbol)

Returns:

Since:

  • 0.5.0



48
49
50
# File 'lib/smart_core/initializer.rb', line 48

def get_type(name)
  types.resolve(name)
end

.included(child_klass) ⇒ void

This method returns an undefined value.

Parameters:

  • child_klass (Class)

Since:

  • 0.5.0



28
29
30
31
# File 'lib/smart_core/initializer.rb', line 28

def included(child_klass)
  child_klass.include(InitializationDSL)
  child_klass.include(InstanceAttributeAccessing)
end

.register_type(name, &checker) ⇒ void

This method returns an undefined value.

Parameters:

  • name (String, Symbol)
  • checker (Block)

Since:

  • 0.5.0



39
40
41
# File 'lib/smart_core/initializer.rb', line 39

def register_type(name, &checker)
  types.register(name, checker)
end

.typesSmartCore::Initializer::TypeSet

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:

Since:

  • 0.5.0



56
57
58
# File 'lib/smart_core/initializer.rb', line 56

def types
  @__type_set__
end

Instance Method Details

#initializevoid

Since:

  • 0.5.0



65
# File 'lib/smart_core/initializer.rb', line 65

def initialize(*, **); end