Class: Texd::Configuration::InvalidConfig

Inherits:
Error
  • Object
show all
Defined in:
lib/texd/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(msg, option:, got:, expected: nil) ⇒ InvalidConfig

Returns a new instance of InvalidConfig.



11
12
13
14
15
16
17
18
19
20
# File 'lib/texd/config.rb', line 11

def initialize(msg, option:, got:, expected: nil)
  @option   = option
  @expected = expected

  message  = [format("Invalid configuration option for %p, got %p", option, got)]
  message << msg if msg
  message << format("Valid options are: %p", expected) if expected

  super message.join(" ")
end

Instance Attribute Details

#expectedObject (readonly)

Returns the value of attribute expected.



9
10
11
# File 'lib/texd/config.rb', line 9

def expected
  @expected
end

#optionObject (readonly)

Returns the value of attribute option.



9
10
11
# File 'lib/texd/config.rb', line 9

def option
  @option
end