Class: RailsERD::Diagram::Mermaid
Instance Attribute Summary collapse
#domain, #options
Instance Method Summary
collapse
create, #create, #generate, #initialize, #recurse_into_relationships, #save
Instance Attribute Details
#graph ⇒ Object
Returns the value of attribute graph.
9
10
11
|
# File 'lib/rails_erd/diagram/mermaid.rb', line 9
def graph
@graph
end
|
Instance Method Details
#arrow_body(relationship) ⇒ Object
64
65
66
|
# File 'lib/rails_erd/diagram/mermaid.rb', line 64
def arrow_body(relationship)
relationship.indirect? ? ".." : "--"
end
|
#arrow_head(relationship) ⇒ Object
68
69
70
|
# File 'lib/rails_erd/diagram/mermaid.rb', line 68
def arrow_head(relationship)
relationship.to_many? ? ">" : ""
end
|
#arrow_tail(relationship) ⇒ Object
72
73
74
|
# File 'lib/rails_erd/diagram/mermaid.rb', line 72
def arrow_tail(relationship)
relationship.many_to? ? "<" : ""
end
|
#filename ⇒ Object
52
53
54
|
# File 'lib/rails_erd/diagram/mermaid.rb', line 52
def filename
"#{options.filename}.mmd"
end
|
#relation_arrow(relationship) ⇒ Object
56
57
58
59
60
61
62
|
# File 'lib/rails_erd/diagram/mermaid.rb', line 56
def relation_arrow(relationship)
arrow_body = arrow_body relationship
arrow_head = arrow_head relationship
arrow_tail = arrow_tail relationship
"#{arrow_tail}#{arrow_body}#{arrow_head}"
end
|