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.


74
75
76
77
78
# File 'lib/cl/errors.rb', line 74

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