Class: Cl::RequiresOpts

Inherits:
OptionError
  • Object
show all
Defined in:
lib/cl/errors.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ RequiresOpts

Returns a new instance of RequiresOpts.


40
41
42
43
44
# File 'lib/cl/errors.rb', line 40

def initialize(opts)
  msg = opts.size == 1 ? :requires_opt : :requires_opts
  opts = opts.map { |one, other| "#{one} (required by #{other})" }.join(', ')
  super(msg, opts)
end