Class: Diagrams::Elements::Edge

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

Overview

Represents an edge or link between two nodes in a diagram. Typically connects nodes via their IDs and can have an optional label.

Instance Method Summary collapse

Instance Method Details

#to_hHash{Symbol => String | nil}

Returns a hash representation suitable for serialization.

Returns:

  • (Hash{Symbol => String | nil})


21
22
23
24
# File 'lib/diagrams/elements/edge.rb', line 21

def to_h
  # Start with Dry::Struct's hash and drop nil attributes.
  super.compact
end