Method: Nuggets::Argv::OptionMixin#option

Defined in:
lib/nuggets/argv/option_mixin.rb

#option(*args, &block) ⇒ Object

call-seq:

ARGV.option(short[, long]) -> aString
ARGV.option(short[, long]) { |value| ... } -> anObject

Returns the value associated with the option short (or long) if present in ARGV. Yields that value to the block if given and returns its result.



45
46
47
# File 'lib/nuggets/argv/option_mixin.rb', line 45

def option(*args, &block)
  __opt(block, *args) { |index| at(index + 1) }
end