Sha256: b86419bd4f0dc924aba6abcaca2843cba18a097a4eb6f876f6632f44bb8b158d

Contents?: true

Size: 681 Bytes

Versions: 4

Compression:

Stored size: 681 Bytes

Contents

# frozen_string_literal: true

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

            super(message)
          end
        end

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

            super(message)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
convenient_service-0.16.0 lib/convenient_service/support/castable/exceptions.rb
convenient_service-0.15.0 lib/convenient_service/support/castable/exceptions.rb
convenient_service-0.14.0 lib/convenient_service/support/castable/exceptions.rb
convenient_service-0.13.0 lib/convenient_service/support/castable/exceptions.rb