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

Methods inherited from ParseError

#format_value

Constructor Details

#initialize(param) ⇒ MissingArgument

Returns a new instance of MissingArgument.



116
117
118
119
120
# File 'lib/tty/option/errors.rb', line 116

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