Class: RunKit::Options::Parser
- Inherits:
-
Object
- Object
- RunKit::Options::Parser
- Defined in:
- lib/run_kit/options/parser.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#queue ⇒ Object
readonly
Returns the value of attribute queue.
Instance Method Summary collapse
-
#initialize(config) ⇒ Parser
constructor
A new instance of Parser.
-
#parse(argv) ⇒ Object
Reset transient state, parse argv, and assemble the result.
Constructor Details
#initialize(config) ⇒ Parser
Returns a new instance of Parser.
11 12 13 |
# File 'lib/run_kit/options/parser.rb', line 11 def initialize(config) @config = config end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
9 10 11 |
# File 'lib/run_kit/options/parser.rb', line 9 def config @config end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/run_kit/options/parser.rb', line 9 def @options end |
#queue ⇒ Object (readonly)
Returns the value of attribute queue.
9 10 11 |
# File 'lib/run_kit/options/parser.rb', line 9 def queue @queue end |
Instance Method Details
#parse(argv) ⇒ Object
Reset transient state, parse argv, and assemble the result.
16 17 18 19 20 21 |
# File 'lib/run_kit/options/parser.rb', line 16 def parse(argv) @options, @queue = config.defaults, argv.dup parse_queue validate! end |