Sha256: 604e0ab389294823fb2c47d0f7cebdd40446cd7f2c5fef1216439c13167db9d4

Contents?: true

Size: 715 Bytes

Versions: 4

Compression:

Stored size: 715 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Support
    module Castable
      module Exceptions
        class CastIsNotOverridden < ::ConvenientService::Exception
          def initialize_with_kwargs(klass:)
            message = <<~TEXT
              Cast method (.cast) of `#{klass}` is NOT overridden.
            TEXT

            initialize(message)
          end
        end

        class FailedToCast < ::ConvenientService::Exception
          def initialize_with_kwargs(other:, klass:)
            message = <<~TEXT
              Failed to cast `#{other.inspect}` into `#{klass}`.
            TEXT

            initialize(message)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
convenient_service-0.19.1 lib/convenient_service/support/castable/exceptions.rb
convenient_service-0.19.0 lib/convenient_service/support/castable/exceptions.rb
convenient_service-0.18.0 lib/convenient_service/support/castable/exceptions.rb
convenient_service-0.17.0 lib/convenient_service/support/castable/exceptions.rb