Class: ArchUnit::GraphReporting::Projection::GraphReportSnapshot

Inherits:
Data
  • Object
show all
Defined in:
lib/archunit/graph/projection/graph_report_snapshot.rb

Overview

Immutable graph after filtering, collapsing, aggregation, and counting.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(title:, nodes:, edges:, summary:) ⇒ GraphReportSnapshot

Returns a new instance of GraphReportSnapshot.



12
13
14
15
16
17
18
19
20
21
# File 'lib/archunit/graph/projection/graph_report_snapshot.rb', line 12

def initialize(title:, nodes:, edges:, summary:)
  title = immutable_title(title)
  nodes = immutable_values(nodes, GraphReportNode, :nodes)
  edges = immutable_values(edges, GraphReportEdge, :edges)
  unless summary.is_a?(GraphReportSummary)
    raise ArgumentError, 'summary must be a GraphReportSummary'
  end

  super
end

Instance Attribute Details

#edgesObject (readonly)

Returns the value of attribute edges

Returns:

  • (Object)

    the current value of edges



11
12
13
# File 'lib/archunit/graph/projection/graph_report_snapshot.rb', line 11

def edges
  @edges
end

#nodesObject (readonly)

Returns the value of attribute nodes

Returns:

  • (Object)

    the current value of nodes



11
12
13
# File 'lib/archunit/graph/projection/graph_report_snapshot.rb', line 11

def nodes
  @nodes
end

#summaryObject (readonly)

Returns the value of attribute summary

Returns:

  • (Object)

    the current value of summary



11
12
13
# File 'lib/archunit/graph/projection/graph_report_snapshot.rb', line 11

def summary
  @summary
end

#titleObject (readonly)

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



11
12
13
# File 'lib/archunit/graph/projection/graph_report_snapshot.rb', line 11

def title
  @title
end