nbulaj/alpha_card

View on GitHub
lib/alpha_card/errors/invalid_attribute_type.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

# typed: true
module AlphaCard
  ##
  # AlphaCard resource attributes value error
  class InvalidAttributeType < StandardError
    # Exception constructor. Returns an error with message about
    # wrong attribute value type.
    #
    # @param value [Object] current attribute value
    # @param types [Array] possible attribute types
    def initialize(value, types)
      super("'#{value}' must be an instance of #{types.join(', ')}")
    end
  end
end