Class: ValueGraphTransformation::Graph::Vertex

Inherits:
Object
  • Object
show all
Defined in:
lib/value_graph_transformation/graph/vertex.rb

Overview

A vertex in the graph.

Direct Known Subclasses

Function, Value

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (Vertex) initialize

Returns a new instance of Vertex



12
13
14
15
# File 'lib/value_graph_transformation/graph/vertex.rb', line 12

def initialize()
  @targets = []
  @sources = []
end

Instance Attribute Details

- (Array<Edge>) sources (readonly)

Returns:



10
11
12
# File 'lib/value_graph_transformation/graph/vertex.rb', line 10

def sources
  @sources
end

- (Array<Edge>) targets (readonly)

Returns:



7
8
9
# File 'lib/value_graph_transformation/graph/vertex.rb', line 7

def targets
  @targets
end

Instance Method Details

- (Array<Vertex>) source_vertices

Returns the source vertices

Returns:

  • (Array<Vertex>)

    the source vertices

Specifications:

returns a list of the source vertices



18
19
20
# File 'lib/value_graph_transformation/graph/vertex.rb', line 18

def source_vertices
  sources.collect{|edge| edge.source }
end

- (Array<Vertex>) target_vertices

Returns the target vertices

Returns:

  • (Array<Vertex>)

    the target vertices

Specifications:

returns a list of the target vertices



23
24
25
# File 'lib/value_graph_transformation/graph/vertex.rb', line 23

def target_vertices
  targets.collect{|edge| edge.target }
end