Class: TTY::Option::MissingArgument

Inherits:
ParseError show all
Defined in:
lib/tty/option/errors.rb

Overview

Raised when option requires an argument

Constant Summary collapse

MESSAGE =
"%<type>s %<name>s requires an argument"

Instance Attribute Summary

Attributes inherited from ParseError

#param

Instance Method Summary collapse

Constructor Details

#initialize(param) ⇒ MissingArgument

Returns a new instance of MissingArgument.


100
101
102
103
104
# File 'lib/tty/option/errors.rb', line 100

def initialize(param)
  @param = param
  message = format(MESSAGE, type: param.to_sym, name: param.name)
  super(message)
end