Class: Diagrams::Elements::TimelineSection

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

Overview

Represents a section or age within the timeline, grouping multiple time periods.

Instance Method Summary collapse

Instance Method Details

#to_hHash{Symbol => String | Array<Hash>}

Returns a hash representation suitable for serialization.

Returns:

  • (Hash{Symbol => String | Array<Hash>})


15
16
17
18
19
20
# File 'lib/diagrams/elements/timeline_section.rb', line 15

def to_h
  {
    title:,
    periods: periods.map(&:to_h)
  }
end