Exception: Cindy::CLI::InvalidArgumentError

Inherits:
ArgumentError
  • Object
show all
Defined in:
lib/cindy/cli.rb

Instance Method Summary collapse

Constructor Details

#initialize(given, expected) ⇒ InvalidArgumentError

Returns a new instance of InvalidArgumentError.



8
9
10
11
12
13
14
15
# File 'lib/cindy/cli.rb', line 8

def initialize(given, expected)
    super "invalid argument '#{given}'" + case expected
        when String
            ", expecting '#{expected}'"
        when Array
            ", expecting one of: '#{expected.join('\', \'')}'"
    end
end