Exception: ActiveModule::InvalidModuleValue

Inherits:
StandardError
  • Object
show all
Defined in:
lib/active_module/invalid_module_value.rb

Instance Method Summary collapse

Constructor Details

#initialize(value, possible_modules:, possible_symbols:) ⇒ InvalidModuleValue

Returns a new instance of InvalidModuleValue.



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/active_module/invalid_module_value.rb', line 5

def initialize(value,
               possible_modules:,
               possible_symbols:)
  super(<<~ERROR_MESSAGE)
    Invalid active_module value #{value.inspect}:
    It must be one of these modules:
     #{possible_modules.inspect}

    Or one of their referring symbols
     #{possible_symbols.inspect}

    Or corresponding strings:
     #{possible_symbols.map(&:to_s).inspect}
  ERROR_MESSAGE
end