class RemiLib::DependencyGraph::Node(N, T)

Overview

A single item within a DependencyGraph. This wraps a single data item of type T, associating it with a particular name of type N.

When resolving dependencies, for each item of type T, a procedure of type Proc(N, T, Nil) will be called.

Defined in:

remilib/dependencygraph.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(name : N, data : T) #

Creates a new Node.


[View source]

Instance Method Detail

def <<(dep : Node(N, T)) #

Adds a new dependency for this node. Returns self.


[View source]
def data : T #

The data associated with this dependency.


[View source]
def deps : Array(Node(N, T)) #

The other things that this node depends on.


[View source]
def dryRun(resolved : Array(Node(N, T)), seen : Array(Node(N, T))) : Nil #

Resolves the dependencies for this node. Unlike #resolve, this doesn't run anything, and instead is used simply to determine the order of dependency resolution.


[View source]
def name : N #

The name associated with this dependency.


[View source]
def resolve(fn : Proc(N, T, Nil), resolved : Array(Node(N, T)), seen : Array(Node(N, T))) : Nil #

Resolves the dependencies for this node, then runs fn.


[View source]