Class: Anyway::OptionParserBuilder

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

Overview

Initializes the OptionParser instance using the given configuration

Class Method Summary collapse

Class Method Details

.call(options) ⇒ Object



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

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