Class: Gem::Resolver::Molinillo::DependencyGraph::DeleteEdge
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Action
|
|
Instance Chain:
self,
Action
|
|
Inherits: |
Gem::Resolver::Molinillo::DependencyGraph::Action
|
Defined in: | lib/rubygems/resolver/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/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb', line 55
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/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb', line 11
def self.action_name :delete_edge end
Instance Attribute Details
#destination_name ⇒ String
(readonly)
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb', line 36
attr_reader :destination_name
#origin_name ⇒ String
(readonly)
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb', line 33
attr_reader :origin_name
#requirement ⇒ Object
(readonly)
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb', line 39
attr_reader :requirement
Instance Method Details
#down(graph) ⇒ Void
Reverses the action on the given graph.
# File 'lib/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb', line 23
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/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb', line 43
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/rubygems/resolver/molinillo/lib/molinillo/dependency_graph/delete_edge.rb', line 16
def up(graph) edge = make_edge(graph) edge.origin.outgoing_edges.delete(edge) edge.destination.incoming_edges.delete(edge) end