Class: ComputedModel::Plan Private

Inherits:
Object
  • Object
show all
Defined in:
lib/computed_model/plan.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A plan for batch loading. Created by DepGraph::Sorted#plan.

Defined Under Namespace

Classes: Node

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(load_order, toplevel) ⇒ Plan

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Plan.

Parameters:



17
18
19
20
21
# File 'lib/computed_model/plan.rb', line 17

def initialize(load_order, toplevel)
  @load_order = load_order.freeze
  @nodes = load_order.map { |node| [node.name, node] }.to_h
  @toplevel = toplevel
end

Instance Attribute Details

#load_orderArray<ComputedModel::Plan::Node> (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns fields in load order.

Returns:



11
12
13
# File 'lib/computed_model/plan.rb', line 11

def load_order
  @load_order
end

#toplevelSet<Symbol> (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns toplevel dependencies.

Returns:

  • (Set<Symbol>)

    toplevel dependencies



13
14
15
# File 'lib/computed_model/plan.rb', line 13

def toplevel
  @toplevel
end

Instance Method Details

#[](name) ⇒ ComputedModel::Plan::Node?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • name (Symbol)

Returns:



25
26
27
# File 'lib/computed_model/plan.rb', line 25

def [](name)
  @nodes[name]
end