Class: TTY::Option::ParseError

Inherits:
Error
  • Object
show all
Defined in:
lib/tty/option/errors.rb

Overview

Raised during command line input parsing

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#paramObject

Returns the value of attribute param.



24
25
26
# File 'lib/tty/option/errors.rb', line 24

def param
  @param
end

Instance Method Details

#format_value(value) ⇒ String

Format value

Examples:

format_value([:a, 1])
# => a:1

Parameters:

  • value (Object)

    the value to format

Returns:

  • (String)


38
39
40
# File 'lib/tty/option/errors.rb', line 38

def format_value(value)
  value.respond_to?(:to_ary) ? value.join(":") : value.to_s
end