Class: Course::Conditional::SatisfiabilityGraphBuildService

Inherits:
Object
  • Object
show all
Defined in:
app/services/course/conditional/satisfiability_graph_build_service.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.build(course) ⇒ Object

Build and cache the satisfiability graph for the given course.

Parameters:

  • course (Course)

    The course to build the satsifiability graph


7
8
9
10
# File 'app/services/course/conditional/satisfiability_graph_build_service.rb', line 7

def build(course) # rubocop:disable Delegate
  # TODO: Cache the satisfiability graph
  new.build(course)
end

Instance Method Details

#build(course) ⇒ Course::Conditional::UserSatisfiabilityGraph

Build the satisfiability graph for the given course.

Parameters:

  • course (Course)

    The course to build the satsifiability graph

Returns:


17
18
19
# File 'app/services/course/conditional/satisfiability_graph_build_service.rb', line 17

def build(course)
  Course::Conditional::UserSatisfiabilityGraph.new(Course::Condition.conditionals_for(course))
end