Module: Argy
- Defined in:
- lib/argy.rb,
lib/argy/help.rb,
lib/argy/option.rb,
lib/argy/parser.rb,
lib/argy/options.rb,
lib/argy/version.rb,
lib/argy/argument.rb,
lib/argy/parameter.rb
Defined Under Namespace
Classes: Argument, Help, Option, Options, Parameter, ParseError, Parser
Constant Summary collapse
- Error =
Base class for all of Argy's errors.
Class.new(StandardError)
- CoersionError =
An error that is raised when an option cannot be coerced to the correct type
Class.new(Error)
- ValidationError =
An error that is raised when an option is not valid.
Class.new(Error)
- VERSION =
"0.2.3"
Class Method Summary collapse
-
.new(&block) ⇒ Object
Define a new parser.
-
.parse(argv: ARGV, &block) ⇒ Object
Define a parser and return the options in one go.
Class Method Details
.new(&block) ⇒ Object
Define a new parser.
37 38 39 |
# File 'lib/argy.rb', line 37 def self.new(&block) Argy::Parser.new(&block) end |
.parse(argv: ARGV, &block) ⇒ Object
Define a parser and return the options in one go.
48 49 50 |
# File 'lib/argy.rb', line 48 def self.parse(argv: ARGV, &block) new(&block).parse(argv) end |