Class: Diagrams::Elements::Node

Inherits:
Dry::Struct
  • Object
show all
Includes:
Types
Defined in:
lib/diagrams/elements/node.rb

Overview

Represents a node in various diagram types (e.g., Flowchart). Typically has an identifier and a display label.

Instance Method Summary collapse

Instance Method Details

#to_hHash{Symbol => String}

Returns a hash representation suitable for serialization.

Returns:

  • (Hash{Symbol => String})


19
20
21
22
23
24
# File 'lib/diagrams/elements/node.rb', line 19

def to_h
  {
    id:,
    label:
  }
end