class SyntaxTree::Mermaid::Node

This class represents a node in a flowchart. Unlike the Link class, it can be used directly. It is the return value of the node method, and is meant to be passed around to link methods to create links between nodes.

Constants

SHAPES

Attributes

id[R]
label[R]
shape[R]

Public Class Methods

new(id, label, shape) click to toggle source
# File lib/syntax_tree/mermaid.rb, line 126
def initialize(id, label, shape)
  raise unless SHAPES.include?(shape)

  @id = id
  @label = label
  @shape = shape
end

Public Instance Methods

render() click to toggle source
# File lib/syntax_tree/mermaid.rb, line 134
def render
  left_bound, right_bound = bounds
  "#{id}#{left_bound}#{Mermaid.escape(label)}#{right_bound}"
end