Exception: Solve::Errors::UnsortableSolutionError

Inherits:
SolveError
  • Object
show all
Defined in:
lib/solve/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(internal_exception, unsorted_solution) ⇒ UnsortableSolutionError

Returns a new instance of UnsortableSolutionError.



39
40
41
42
# File 'lib/solve/errors.rb', line 39

def initialize(internal_exception, unsorted_solution)
  @internal_exception = internal_exception
  @unsorted_solution  = unsorted_solution
end

Instance Attribute Details

#internal_exceptionObject (readonly)

Returns the value of attribute internal_exception.



36
37
38
# File 'lib/solve/errors.rb', line 36

def internal_exception
  @internal_exception
end

#unsorted_solutionObject (readonly)

Returns the value of attribute unsorted_solution.



37
38
39
# File 'lib/solve/errors.rb', line 37

def unsorted_solution
  @unsorted_solution
end

Instance Method Details

#to_sObject



44
45
46
# File 'lib/solve/errors.rb', line 44

def to_s
  "The solution contains a cycle and cannot be topologically sorted. See #unsorted_solution on this exception for the unsorted solution"
end