module Solve
def engine=(selected_engine)
-
(Solve::Errors::InvalidEngine)
- when `selected_engine` is invalid. -
(Solve::Errors::EngineNotAvailable)
- when the selected engine's deps aren't installed.
Returns:
-
(Symbol)
- selected_engine
Parameters:
-
selected_engine
(Symbol
) --
def engine=(selected_engine) engine_class = solver_for_engine(selected_engine) if engine_class.nil? raise Errors::InvalidEngine, "Engine `#{selected_engine}` is not supported. Valid values are `:ruby`, `:gecode`" else engine_class.activate end @engine = selected_engine end