nbulaj/alpha_card

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

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true

# typed: true
module AlphaCard
  ##
  # AlphaCard resource attributes value error
  class InvalidAttributeValue < StandardError
    # Exception constructor. Returns an error with message about wrong value
    # and possible values.
    #
    # @param value [Object] current attribute value
    # @param values [Array] possible attribute values
    def initialize(value, values)
      super("'#{value}' is invalid attribute value. Use one from the following: #{values.join(', ')}")
    end
  end
end