Class: ComputedModel::Plan Private
- Inherits:
-
Object
- Object
- ComputedModel::Plan
- 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
-
#load_order ⇒ Array<ComputedModel::Plan::Node>
readonly
private
Fields in load order.
-
#toplevel ⇒ Set<Symbol>
readonly
private
Toplevel dependencies.
Instance Method Summary collapse
- #[](name) ⇒ ComputedModel::Plan::Node? private
-
#initialize(load_order, toplevel) ⇒ Plan
constructor
private
A new instance of Plan.
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.
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_order ⇒ Array<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.
11 12 13 |
# File 'lib/computed_model/plan.rb', line 11 def load_order @load_order end |
#toplevel ⇒ Set<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.
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.
25 26 27 |
# File 'lib/computed_model/plan.rb', line 25 def [](name) @nodes[name] end |