Sha256: d69f4dffa7c9b98a5a88c9fc6231b9e7141ea26cd3737f8c3aa79f7a7df9d6aa

Contents?: true

Size: 647 Bytes

Versions: 14

Compression:

Stored size: 647 Bytes

Contents

# frozen_string_literal: true

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

            super(message)
          end
        end

        class FailedToCast < ::StandardError
          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

14 entries across 14 versions & 1 rubygems

Version Path
convenient_service-0.11.0 lib/convenient_service/support/castable/errors.rb
convenient_service-0.10.1 lib/convenient_service/support/castable/errors.rb
convenient_service-0.10.0 lib/convenient_service/support/castable/errors.rb
convenient_service-0.9.0 lib/convenient_service/support/castable/errors.rb
convenient_service-0.8.0 lib/convenient_service/support/castable/errors.rb
convenient_service-0.7.0 lib/convenient_service/support/castable/errors.rb
convenient_service-0.6.0 lib/convenient_service/support/castable/errors.rb
convenient_service-0.5.0 lib/convenient_service/support/castable/errors.rb
convenient_service-0.4.0 lib/convenient_service/support/castable/errors.rb
convenient_service-0.3.1 lib/convenient_service/support/castable/errors.rb
convenient_service-0.3.0 lib/convenient_service/support/castable/errors.rb
convenient_service-0.2.1 lib/convenient_service/support/castable/errors.rb
convenient_service-0.2.0 lib/convenient_service/support/castable/errors.rb
convenient_service-0.1.0 lib/convenient_service/support/castable/errors.rb