class Doterd::Renderer::Relation

Public Class Methods

call(relation, from, to) click to toggle source
# File lib/doterd.rb, line 146
def self.call(relation, from, to)
  "#{from} -> #{to} #{label relation}"
end
label(relation) click to toggle source
# File lib/doterd.rb, line 150
def self.label(relation)
  case relation
  when :_1_1
    "[arrowhead=odot, arrowtail=odot, dir=both]"
  when :_1_N
    "[arrowhead=inv, arrowtail=odot, dir=both]"
  when :_N_1
    "[arrowhead=odot, arrowtail=inv, dir=both]"
  when :_N_N
    "[arrowhead=inv, arrowtail=inv, dir=both]"
  else
    raise "Relation not found for #{relation}"
  end
end