Class: TTY::Link::AbstractMethodError

Inherits:
Error
  • Object
show all
Defined in:
lib/tty/link/errors.rb

Overview

Raised when an abstract method is called

Constant Summary collapse

MESSAGE =
"the %<class_name>s class must implement " \
"the `%<method_name>s` method"

Instance Method Summary collapse

Constructor Details

#initialize(class_name, method_name) ⇒ AbstractMethodError

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.

Create an TTY::Link::AbstractMethodError instance

Examples:

TTY::Link::AbstractMethodError.new("Terminal", "name?")

Parameters:

  • class_name (String)

    the class name

  • method_name (Symbol)

    the method name



28
29
30
# File 'lib/tty/link/errors.rb', line 28

def initialize(class_name, method_name)
  super(format(MESSAGE, class_name: class_name, method_name: method_name))
end