class Molinillo::DependencyGraph(P, R)

Defined in:

molinillo/dependency_graph.cr:1
molinillo/dependency_graph.cr:7
molinillo/dependency_graph/add_edge_no_circular.cr
molinillo/dependency_graph/add_vertex.cr
molinillo/dependency_graph/delete_edge.cr
molinillo/dependency_graph/detach_vertex_named.cr
molinillo/dependency_graph/set_payload.cr
molinillo/dependency_graph/tag.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Instance Method Detail

def ==(other) #
Description copied from class Reference

Returns false (other can only be a Value here).


[View source]
def add_child_vertex(name : String, payload : P, parent_names : Array(String | Nil), requirement : R) #

@param [String] name @param [Object] payload @param [Array] parent_names @param [Object] requirement the requirement that is requiring the child @return [void]


[View source]
def add_edge(origin : Vertex(P, R), destination : Vertex(P, R), requirement : R) #

Adds a new {Edge} to the dependency graph @param [Vertex] origin @param [Vertex] destination @param [Object] requirement the requirement that this edge represents @return [Edge] the added edge


[View source]
def add_vertex(name : String, payload : P, root : Bool = false) #

Adds a vertex with the given name, or updates the existing one. @param [String] name @param [Object] payload @return [Vertex] the vertex that was added to self


[View source]
def detach_vertex_named(name) #

Detaches the {#vertex_named} name {Vertex} from the graph, recursively removing any non-root vertices that were orphaned in the process @param [String] name @return [Array] the vertices which have been detached


[View source]
def each(&) #

Enumerates through the vertices of the graph. @return [Array] The graph's vertices.


[View source]
def inspect #
Description copied from class Object

Returns an unambiguous and information-rich string representation of this object, typically intended for developers.

This method should usually not be overridden. It delegates to #inspect(IO) which can be overridden for custom implementations.

Also see #to_s.


[View source]
def log : Log(P, R) #

[View source]
def path(from, to) #

Returns the path between two vertices @raise [ArgumentError] if there is no path between the vertices @param [Vertex] from @param [Vertex] to @return [Array] the shortest path from from to to


[View source]
def rewind_to(tag) #

Rewinds the graph to the state tagged as #tag @param [Object] tag the tag to rewind to @return [Void]


[View source]
def root_vertex_named(name) : Vertex(P, R) | Nil #

@param [String] name @return [Vertex,nil] the root vertex with the given name


[View source]
def set_payload(name, payload) #

Sets the payload of the vertex with the given name @param [String] name the name of the vertex @param [Object] payload the payload @return [Void]


[View source]
def tag(tag : Symbol | Reference) #

Tags the current state of the dependency as the given tag @param [Object] tag an opaque tag for the current state of the graph @return [Void]


[View source]
def to_dot #

[View source]
def vertex_named(name) : Vertex(P, R) | Nil #

@param [String] name @return [Vertex,nil] the vertex with the given name


[View source]
def vertex_named!(name) : Vertex(P, R) #

@param [String] name @return [Vertex,nil] the vertex with the given name


[View source]
def vertices : Hash(String, Vertex(P, R)) #

[View source]