Class: Diagrams::Elements::GitBranch

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

Overview

Represents a branch in a Gitgraph diagram.

Instance Method Summary collapse

Instance Method Details

#to_hHash{Symbol => String}

Returns a hash representation suitable for serialization.

Returns:

  • (Hash{Symbol => String})


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