Class: Runger::OptionParserBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/runger/option_parser_builder.rb

Overview

Initializes the OptionParser instance using the given configuration

Class Method Summary collapse

Class Method Details

.call(options) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/runger/option_parser_builder.rb', line 8

def call(options)
  OptionParser.new do |opts|
    options.each do |key, descriptor|
      opts.on(*option_parser_on_args(key, **descriptor)) do |val|
        yield([key, val])
      end
    end
  end
end