Class: Cukunity::CLI::ArgumentParser
- Inherits:
-
Object
- Object
- Cukunity::CLI::ArgumentParser
- Defined in:
- lib/cukunity/cli/argument_parser.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#remaining_args ⇒ Object
readonly
Returns the value of attribute remaining_args.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(args) ⇒ ArgumentParser
constructor
A new instance of ArgumentParser.
- #parse ⇒ Object
Constructor Details
#initialize(args) ⇒ ArgumentParser
Returns a new instance of ArgumentParser.
16 17 18 |
# File 'lib/cukunity/cli/argument_parser.rb', line 16 def initialize(args) @args = args.dup end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
6 7 8 |
# File 'lib/cukunity/cli/argument_parser.rb', line 6 def args @args end |
#command ⇒ Object (readonly)
Returns the value of attribute command.
9 10 11 |
# File 'lib/cukunity/cli/argument_parser.rb', line 9 def command @command end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/cukunity/cli/argument_parser.rb', line 8 def @options end |
#remaining_args ⇒ Object (readonly)
Returns the value of attribute remaining_args.
7 8 9 |
# File 'lib/cukunity/cli/argument_parser.rb', line 7 def remaining_args @remaining_args end |
Class Method Details
.parse(args) ⇒ Object
11 12 13 14 |
# File 'lib/cukunity/cli/argument_parser.rb', line 11 def self.parse(args) parser = new(args) parser.parse end |
Instance Method Details
#parse ⇒ Object
20 21 22 23 |
# File 'lib/cukunity/cli/argument_parser.rb', line 20 def parse parse_command end |