Class: RunKit::Options::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/run_kit/options/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#configObject (readonly)

Returns the value of attribute config.



9
10
11
# File 'lib/run_kit/options/parser.rb', line 9

def config
  @config
end

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/run_kit/options/parser.rb', line 9

def options
  @options
end

#queueObject (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!
  options
end