Class: RailsGraph::Commands::Builders::Models

Inherits:
Object
  • Object
show all
Defined in:
lib/rails_graph/commands/builders/models.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#graphObject (readonly)

Returns the value of attribute graph.



7
8
9
# File 'lib/rails_graph/commands/builders/models.rb', line 7

def graph
  @graph
end

#inspectorObject (readonly)

Returns the value of attribute inspector.



7
8
9
# File 'lib/rails_graph/commands/builders/models.rb', line 7

def inspector
  @inspector
end

Class Method Details

.enrichObject



9
10
11
# File 'lib/rails_graph/commands/builders/models.rb', line 9

def self.enrich(...)
  new(...).enrich
end

Instance Method Details

#enrichObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/rails_graph/commands/builders/models.rb', line 13

def enrich
  build_model_nodes
  build_associations
  build_column_nodes if configuration.columns?
  build_model_table_relationships if configuration.databases?
  build_inheritance_relationships if configuration.inheritance?

  inspector.log
  graph
end