Class: Bundler::Molinillo::DependencyGraph::DeleteEdge
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Action
|
|
Instance Chain:
self,
Action
|
|
Inherits: |
Bundler::Molinillo::DependencyGraph::Action
|
Defined in: | lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb |
Overview
(see #delete_edge)
Action
- .action_name ⇒ Symbol
-
#down(graph) ⇒ Void
Reverses the action on the given graph.
-
#up(graph) ⇒ Void
Performs the action on the given graph.
DeleteEdge
- #destination_name ⇒ String readonly
- #make_edge(graph) ⇒ Edge
-
.new(origin_name, destination_name, requirement) ⇒ DeleteEdge
constructor
Initialize an action to add an edge to a dependency graph.
- #origin_name ⇒ String readonly
- #requirement ⇒ Object readonly
Class Method Summary
Action
- Inherited
Instance Attribute Summary
Instance Method Summary
Action
- Inherited
Constructor Details
.new(origin_name, destination_name, requirement) ⇒ DeleteEdge
Initialize an action to add an edge to a dependency graph
# File 'lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb', line 56
def initialize(origin_name, destination_name, requirement) @origin_name = origin_name @destination_name = destination_name @requirement = requirement end
Class Method Details
.action_name ⇒ Symbol
# File 'lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb', line 12
def self.action_name :delete_edge end
Instance Attribute Details
#destination_name ⇒ String
(readonly)
# File 'lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb', line 37
attr_reader :destination_name
#origin_name ⇒ String
(readonly)
# File 'lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb', line 34
attr_reader :origin_name
#requirement ⇒ Object
(readonly)
# File 'lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb', line 40
attr_reader :requirement
Instance Method Details
#down(graph) ⇒ Void
Reverses the action on the given graph.
# File 'lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb', line 24
def down(graph) edge = make_edge(graph) edge.origin.outgoing_edges << edge edge.destination.incoming_edges << edge edge end
#make_edge(graph) ⇒ Edge
# File 'lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb', line 44
def make_edge(graph) Edge.new( graph.vertex_named(origin_name), graph.vertex_named(destination_name), requirement ) end
#up(graph) ⇒ Void
Performs the action on the given graph.
# File 'lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb', line 17
def up(graph) edge = make_edge(graph) edge.origin.outgoing_edges.delete(edge) edge.destination.incoming_edges.delete(edge) end