method

define_by_keywords

Importance_0
v2_5_5 - Show latest stable - 0 notes - Class: OptionParser
define_by_keywords(options, meth, **opts) public

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/optparse/kwargs.rb, line 5
  def define_by_keywords(options, meth, **opts)
    meth.parameters.each do |type, name|
      case type
      when :key, :keyreq
        op, cl = *(type == :key ? %[ ]" : ["", ""])
        define("--#{name}=#{op}#{name.upcase}#{cl}", *opts[name]) do |o|
          options[name] = o
        end
      end
    end
    options
  end
Register or log in to add new notes.