Class: Diagrams::Elements::Task
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Diagrams::Elements::Task
- Includes:
- Types
- Defined in:
- lib/diagrams/elements/task.rb
Overview
Represents a task in a Gantt Diagram.
Constant Summary collapse
- STATUS =
Status symbols allowed by Mermaid Gantt
Types::Strict::Symbol.enum(:done, :active, :crit)
Instance Method Summary collapse
-
#to_h ⇒ Hash{Symbol => String | Symbol | nil}
Returns a hash representation suitable for serialization.
Instance Method Details
#to_h ⇒ Hash{Symbol => String | Symbol | nil}
Returns a hash representation suitable for serialization.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/diagrams/elements/task.rb', line 23 def to_h hash = { id: id, label: label, start: start, duration: duration } hash[:status] = status if status # Include status only if set hash end |