class Gem::Molinillo::DependencyGraph::DeleteEdge

@!visibility private (请参阅 DependencyGraph#delete_edge)

属性

destination_name[R]

@return [String] 边的目标节点的名称

origin_name[R]

@return [String] 边的起始节点的名称

requirement[R]

@return [Object] 边所代表的需求

公共类方法

action_name() 点击以切换源代码

(请参阅 Action.action_name)

# File rubygems/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb, line 12
def self.action_name
  :delete_edge
end
new(origin_name, destination_name, requirement) 点击以切换源代码

初始化一个向依赖关系图添加边的操作 @param [String] origin_name 边的起始节点的名称 @param [String] destination_name 边的目标节点的名称 @param [Object] requirement 边所代表的需求

# File rubygems/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

公共实例方法

down(graph) 点击以切换源代码

(请参阅 Action#down)

# File rubygems/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) 点击以切换源代码

@param [DependencyGraph] graph 从中查找顶点的图 @return [Edge] 此操作添加的边

# File rubygems/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) 点击以切换源代码

(请参阅 Action#up)

# File rubygems/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