Class: Diagrams::Elements::GitBranch
- Inherits:
-
Dry::Struct
- Object
- Dry::Struct
- Diagrams::Elements::GitBranch
- Includes:
- Types
- Defined in:
- lib/diagrams/elements/git_branch.rb
Overview
Represents a branch in a Gitgraph diagram.
Instance Method Summary collapse
-
#to_h ⇒ Hash{Symbol => String}
Returns a hash representation suitable for serialization.
Instance Method Details
#to_h ⇒ Hash{Symbol => String}
Returns a hash representation suitable for serialization.
17 18 19 20 21 22 23 24 |
# File 'lib/diagrams/elements/git_branch.rb', line 17 def to_h hash = { name:, start_commit_id: } hash[:head_commit_id] = head_commit_id if head_commit_id hash end |