Class: ModelsDiagram
- Inherits:
-
AppDiagram
- Object
- AppDiagram
- ModelsDiagram
- Defined in:
- lib/railroad/models_diagram.rb
Overview
RailRoad models diagram
Instance Method Summary collapse
-
#generate ⇒ Object
Process model files.
-
#initialize(options) ⇒ ModelsDiagram
constructor
A new instance of ModelsDiagram.
Methods inherited from AppDiagram
Constructor Details
#initialize(options) ⇒ ModelsDiagram
Returns a new instance of ModelsDiagram.
12 13 14 15 16 17 18 |
# File 'lib/railroad/models_diagram.rb', line 12 def initialize() #options.exclude.map! {|e| "app/models/" + e} super @graph.diagram_type = 'Models' # Processed habtm associations @habtm = [] end |
Instance Method Details
#generate ⇒ Object
Process model files
21 22 23 24 25 26 27 28 29 |
# File 'lib/railroad/models_diagram.rb', line 21 def generate STDERR.print "Generating models diagram\n" if @options.verbose files = Dir.glob("app/models/**/*.rb") files += Dir.glob("vendor/plugins/**/app/models/*.rb") if @options.plugins_models files -= @options.exclude files.each do |f| process_class extract_class_name(f).constantize end end |