Module: RailsERD::Diagram::Graphviz::Uml
- Includes:
- Simple
- Defined in:
- lib/rails_erd/diagram/graphviz.rb
Instance Method Summary collapse
Methods included from Simple
#entity_style, #specialization_style
Instance Method Details
#relationship_style(relationship) ⇒ Object
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 |
# File 'lib/rails_erd/diagram/graphviz.rb', line 161 def relationship_style(relationship) {}.tap do || [:style] = :dotted if relationship.indirect? [:arrowsize] = 0.7 [:arrowhead] = relationship.to_many? ? "vee" : "none" [:arrowtail] = relationship.many_to? ? "vee" : "none" ranges = [relationship.cardinality.destination_range, relationship.cardinality.source_range].map do |range| if range.min == range.max "#{range.min}" else "#{range.min}..#{range.max == Domain::Relationship::N ? "∗" : range.max}" end end [:headlabel], [:taillabel] = *ranges end end |