module RubyToUML::UMLDiagramRenderer

Public Class Methods

create_diagram(dsl_string) click to toggle source
# File lib/ruby_to_uml/uml_diagram_renderer/uml_diagram_renderer.rb, line 6
def self.create_diagram(dsl_string)
  html = render_diagram(dsl_string)
  save_html_file(html)
end

Private Class Methods

render_diagram(dsl_string) click to toggle source
# File lib/ruby_to_uml/uml_diagram_renderer/uml_diagram_renderer.rb, line 14
def render_diagram(dsl_string)
  absolute_path = File.expand_path('uml_diagram_template.erb', __dir__)
  template = Tilt.new(absolute_path)
  template.render(Object.new, dsl_string: dsl_string)
end
save_html_file(data) click to toggle source
# File lib/ruby_to_uml/uml_diagram_renderer/uml_diagram_renderer.rb, line 20
def save_html_file(data)
  File.open('uml_class_diagram.html', 'w') do |file|
    file << data
  end
end