Class: Diagrams::Elements::ERDAttribute
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Diagrams::Elements::ERDAttribute
- Includes:
- Types
- Defined in:
- lib/diagrams/elements/erd_attribute.rb
Overview
Represents an attribute within an ERD entity.
Instance Method Summary collapse
-
#to_h ⇒ Hash{Symbol => String | Array<Symbol>}
Returns a hash representation suitable for serialization.
Instance Method Details
#to_h ⇒ Hash{Symbol => String | Array<Symbol>}
Returns a hash representation suitable for serialization.
17 18 19 20 21 22 23 24 25 |
# File 'lib/diagrams/elements/erd_attribute.rb', line 17 def to_h hash = { type:, name:, keys: keys.map(&:to_s) # Convert symbols to strings for serialization } hash[:comment] = comment if comment hash end |