Module: ConvenientService::Support::Castable

Extended by:
AbstractMethod
Includes:
Concern
Included in:
Common::Plugins::CanHaveCallbacks::Entities::Type, Core::Entities::Config::Entities::Concerns::Entities::Middleware
Defined in:
lib/convenient_service/support/castable.rb,
lib/convenient_service/support/castable/exceptions.rb

Overview

TODO: Specs for options.

Defined Under Namespace

Modules: Exceptions

Class Method Summary collapse

Methods included from AbstractMethod

abstract_method

Class Method Details

.cast!(other, **options) ⇒ Object



34
35
36
37
38
39
40
# File 'lib/convenient_service/support/castable.rb', line 34

def cast!(other, **options)
  casted = cast(other, **options)

  ::ConvenientService.raise Exceptions::FailedToCast.new(other: other, klass: self) unless casted

  casted
end