Class: AppDiagram
- Inherits:
-
Object
- Object
- AppDiagram
- Defined in:
- lib/railroad/app_diagram.rb
Overview
Root class for RailRoad diagrams
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(options = OptionsStruct.new) ⇒ AppDiagram
constructor
A new instance of AppDiagram.
-
#print ⇒ Object
Print diagram.
-
#process ⇒ Object
print.
Constructor Details
#initialize(options = OptionsStruct.new) ⇒ AppDiagram
Returns a new instance of AppDiagram.
33 34 35 36 37 |
# File 'lib/railroad/app_diagram.rb', line 33 def initialize( = OptionsStruct.new) @options = @graph = DiagramGraph.new @graph.show_label = @options.label end |
Instance Method Details
#print ⇒ Object
Print diagram
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/railroad/app_diagram.rb', line 41 def print if @options.output old_stdout = STDOUT.dup begin STDOUT.reopen(@options.output) rescue STDERR.print "Error: Cannot write diagram to #{@options.output}\n\n" exit 2 end end if @options.xmi STDERR.print "Generating XMI diagram\n" if @options.verbose STDOUT.print @graph.to_xmi else STDERR.print "Generating DOT graph\n" if @options.verbose STDOUT.print @graph.to_dot end if @options.output STDOUT.reopen(old_stdout) end end |
#process ⇒ Object
65 66 67 |
# File 'lib/railroad/app_diagram.rb', line 65 def process load_environment end |