Class: Diagrams::Elements::Relationship

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

Overview

Represents a relationship (e.g., association, inheritance) between two classes in a UML Class Diagram.

Instance Method Summary collapse

Instance Method Details

#to_hHash{Symbol => String | nil}

Returns a hash representation suitable for serialization.

Returns:

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


27
28
29
30
# File 'lib/diagrams/elements/relationship.rb', line 27

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