Class: TTY::Option::Parameter::Argument
- Inherits:
-
TTY::Option::Parameter
- Object
- TTY::Option::Parameter
- TTY::Option::Parameter::Argument
- Defined in:
- lib/tty/option/parameter/argument.rb
Constant Summary
Constants inherited from TTY::Option::Parameter
ONE_OR_MORE_ARITY, ZERO_OR_MORE_ARITY
Instance Attribute Summary
Attributes inherited from TTY::Option::Parameter
Instance Method Summary collapse
-
#required? ⇒ Boolean
Required by default unless the arity allows any.
Methods inherited from TTY::Option::Parameter
#<=>, #==, #arity, #convert, #convert?, create, #default, #default?, #default_arity, #default_name, #desc, #desc?, #display?, #dup, #eql?, #hidden, #hidden?, #initialize, #min_arity, #multi_argument?, #multiple?, #name, #optional, #optional?, #permit, #permit?, #required, #to_h, #to_sym, #validate, #validate?
Methods included from DSL::Conversion
Methods included from DSL::Arity
#at_least, #one, #one_or_more, #two, #two_or_more, #zero_or_more
Constructor Details
This class inherits a constructor from TTY::Option::Parameter
Instance Method Details
#required? ⇒ Boolean
Required by default unless the arity allows any
12 13 14 |
# File 'lib/tty/option/parameter/argument.rb', line 12 def required? @settings.fetch(:required) { arity != -1 } end |