Exception: Qywx::Client::ConfigurationError

Inherits:
Error
  • Object
show all
Defined in:
lib/qywx/client/errors.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key, value, valid_values) ⇒ ConfigurationError

Returns a new instance of ConfigurationError.



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/qywx/client/errors.rb', line 12

def initialize(key, value, valid_values)
  @key          = key
  @valud        = value
  @valid_values = valid_values
  valid_values_str = Array(valid_values).join(', ')
  message = if value.blank?
              "#{key} not configured or configured with blank value, valid_values: #{valid_values_str}"
            else
              "Configure #{key} with value #{value} failed, valid_values: #{valid_values_str}"
            end
  super(message)
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



10
11
12
# File 'lib/qywx/client/errors.rb', line 10

def key
  @key
end

#valid_valuesObject (readonly)

Returns the value of attribute valid_values.



10
11
12
# File 'lib/qywx/client/errors.rb', line 10

def valid_values
  @valid_values
end

#valueObject (readonly)

Returns the value of attribute value.



10
11
12
# File 'lib/qywx/client/errors.rb', line 10

def value
  @value
end