Module: TTY::Option::DSL::Arity

Included in:
TTY::Option::DSL, Parameter
Defined in:
lib/tty/option/dsl/arity.rb

Instance Method Summary collapse

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

#oneObject



8
9
10
# File 'lib/tty/option/dsl/arity.rb', line 8

def one
  1
end

#one_or_moreObject

One or more arity



29
30
31
# File 'lib/tty/option/dsl/arity.rb', line 29

def one_or_more
  -2
end

#twoObject



13
14
15
# File 'lib/tty/option/dsl/arity.rb', line 13

def two
  2
end

#two_or_moreObject

Two or more arity



36
37
38
# File 'lib/tty/option/dsl/arity.rb', line 36

def two_or_more
  -3
end

#zero_or_moreObject 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