Exception: RubyArguments::Exceptions::InvalidKeyType

Inherits:
Base
  • Object
show all
Defined in:
lib/ruby_arguments.rb

Overview

Since:

  • 1.0.0

Class Method Summary collapse

Class Method Details

.create(key:) ⇒ RubyArguments::Exceptions::InvalidKeyType

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • key (Object)

    Can be any type.

Returns:

Since:

  • 1.0.0



34
35
36
37
38
39
40
41
42
# File 'lib/ruby_arguments.rb', line 34

def create(key:)
  message = <<~TEXT
    `#[]` accepts only `Integer` and `String` keys.

    Key `#{key.inspect}` has `#{key.class}` class.
  TEXT

  new(message)
end