Method: SmartCore::Types::Primitive#cast

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

#cast(value) ⇒ Any

Parameters:

  • value (Any)

Returns:

  • (Any)

Since:

  • 0.1.0

Version:

  • 0.3.0



161
162
163
164
165
166
# File 'lib/smart_core/types/primitive.rb', line 161

def cast(value)
  # TODO (0.x.0):
  #   refactor with ValueTransformer with internal reference to the type object
  #   in Validator manner (in order to avoid explicit #runtime_attributes passing)
  caster.call(value, runtime_attributes)
end