Class: LabSystem::LizaKrokiClient::PlantumlHelper
- Inherits:
-
Object
- Object
- LabSystem::LizaKrokiClient::PlantumlHelper
- Defined in:
- lib/lab_system/clients/liza_kroki_client.rb
Instance Method Summary collapse
- #association(a, b, arrow) ⇒ Object
- #inheritance(klass) ⇒ Object
- #name_for(klass) ⇒ Object
- #package_box(box, color) ⇒ Object
- #package_object ⇒ Object
- #package_system(system, color) ⇒ Object
- #package_system_in_object(system, color) ⇒ Object
- #rectangle_unit_type(unit_type) ⇒ Object
- #unit_type_for(klass) ⇒ Object
Instance Method Details
#association(a, b, arrow) ⇒ Object
55 56 57 |
# File 'lib/lab_system/clients/liza_kroki_client.rb', line 55 def association a, b, arrow %(#{ name_for a } #{arrow} #{ name_for b }) end |
#inheritance(klass) ⇒ Object
51 52 53 |
# File 'lib/lab_system/clients/liza_kroki_client.rb', line 51 def inheritance klass association klass.superclass, klass, "<|-down--" end |
#name_for(klass) ⇒ Object
21 22 23 24 25 26 27 28 29 |
# File 'lib/lab_system/clients/liza_kroki_client.rb', line 21 def name_for klass return "Liza.Unit" if klass == Liza::Unit if klass.first_namespace == "Liza" return "Liza.#{unit_type_for klass}.#{klass.last_namespace}" end klass = "Object::#{klass}" unless klass.to_s.include? "::" klass.to_s.gsub "::", "." end |
#package_box(box, color) ⇒ Object
43 44 45 |
# File 'lib/lab_system/clients/liza_kroki_client.rb', line 43 def package_box box, color %|node #{ name_for box } as "#{ box.last_namespace }" #{ color };line.bold;line:black;text:black| end |
#package_object ⇒ Object
31 32 33 |
# File 'lib/lab_system/clients/liza_kroki_client.rb', line 31 def package_object "package Object #ffffff;text:000000;line.bold;line:black" end |
#package_system(system, color) ⇒ Object
39 40 41 |
# File 'lib/lab_system/clients/liza_kroki_client.rb', line 39 def package_system system, color "package #{ system } #{ color };line.bold;line:black;text:black" end |
#package_system_in_object(system, color) ⇒ Object
35 36 37 |
# File 'lib/lab_system/clients/liza_kroki_client.rb', line 35 def package_system_in_object system, color "package #{ name_for system } #{ color };line.bold;line:black;text:black" end |
#rectangle_unit_type(unit_type) ⇒ Object
47 48 49 |
# File 'lib/lab_system/clients/liza_kroki_client.rb', line 47 def rectangle_unit_type unit_type %|rectangle Liza.#{ unit_type } as "#{ unit_type } units" #ffffff;text:000000;line.bold;line:black| end |
#unit_type_for(klass) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/lab_system/clients/liza_kroki_client.rb', line 8 def unit_type_for klass case klass.last_namespace when "Test" "safety" when "Box", "Part", "System" "meta" when "Panel", "Controller" "base" else "other" end end |