Exception: Cri::Parser::IllegalOptionValueError

Inherits:
Error
  • Object
show all
Defined in:
lib/cri/parser.rb

Overview

Error that will be raised when an option with an invalid or non-transformable value is encountered.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(definition, value) ⇒ IllegalOptionValueError

Returns a new instance of IllegalOptionValueError



16
17
18
19
# File 'lib/cri/parser.rb', line 16

def initialize(definition, value)
  @definition = definition
  @value      = value
end

Instance Attribute Details

#definitionObject (readonly)

Returns the value of attribute definition



13
14
15
# File 'lib/cri/parser.rb', line 13

def definition
  @definition
end

#valueObject (readonly)

Returns the value of attribute value



14
15
16
# File 'lib/cri/parser.rb', line 14

def value
  @value
end

Instance Method Details

#messageObject



21
22
23
# File 'lib/cri/parser.rb', line 21

def message
  "invalid value #{value.inspect} for #{@definition.formatted_name} option"
end