Class: SmartCore::Types::Primitive::UndefinedCaster Private

Inherits:
Caster
  • Object
show all
Defined in:
lib/smart_core/types/primitive/undefined_caster.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 Method Summary collapse

Constructor Details

#initialize(expression = nil) ⇒ 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.

Parameters:

  • expression (NilClass, Any) (defaults to: nil)

Since:

  • 0.1.0



12
13
14
# File 'lib/smart_core/types/primitive/undefined_caster.rb', line 12

def initialize(expression = nil)
  super
end

Instance Method Details

#call(value, runtime_attributes) ⇒ 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.

Parameters:

  • value (Any)
  • runtime_attributes (Array<Any>)

Raises:

Since:

  • 0.1.0

Version:

  • 0.3.0



25
26
27
28
29
# File 'lib/smart_core/types/primitive/undefined_caster.rb', line 25

def call(value, runtime_attributes)
  raise(SmartCore::Types::TypeCastingUnsupportedError, <<~ERROR_MESSAGE)
    'This type has no support for type casting'
  ERROR_MESSAGE
end