Method: Thor::Base::ClassMethods#build_option

Defined in:
lib/thor/base/class_methods.rb

#build_option(name, options, scope) ⇒ Object (protected)

Build an option and adds it to the given scope.

Parameters

name<Symbol>

The name of the argument.

options<Hash>

Described in both class_option and method_option.

scope<Hash>

Options hash that is being built up



506
507
508
509
510
511
512
# File 'lib/thor/base/class_methods.rb', line 506

def build_option(name, options, scope)
  option = Thor::Option.new(
    name,
    options.merge(:check_default_type => check_default_type?)
  )
  scope[option.name] = option
end