Module: TTY::Option::DSL::Arity
- Included in:
- TTY::Option::DSL, Parameter
- Defined in:
- lib/tty/option/dsl/arity.rb
Instance Method Summary collapse
-
#at_least(number) ⇒ Object
At last number values for arity.
- #one ⇒ Object
-
#one_or_more ⇒ Object
One or more arity.
- #two ⇒ Object
-
#two_or_more ⇒ Object
Two or more arity.
-
#zero_or_more ⇒ Object
(also: #any, #any_args)
Zero or more arity.
Instance Method Details
#at_least(number) ⇒ Object
At last number values for arity
43 44 45 |
# File 'lib/tty/option/dsl/arity.rb', line 43 def at_least(number) -number.to_i - 1 end |
#one ⇒ Object
8 9 10 |
# File 'lib/tty/option/dsl/arity.rb', line 8 def one 1 end |
#one_or_more ⇒ Object
One or more arity
29 30 31 |
# File 'lib/tty/option/dsl/arity.rb', line 29 def one_or_more -2 end |
#two ⇒ Object
13 14 15 |
# File 'lib/tty/option/dsl/arity.rb', line 13 def two 2 end |
#two_or_more ⇒ Object
Two or more arity
36 37 38 |
# File 'lib/tty/option/dsl/arity.rb', line 36 def two_or_more -3 end |
#zero_or_more ⇒ Object Also known as: any, any_args
Zero or more arity
20 21 22 |
# File 'lib/tty/option/dsl/arity.rb', line 20 def zero_or_more -1 end |