summaryrefslogtreecommitdiff
path: root/app/graphql/types/sha_format_enum.rb
blob: 2e0e5bb85f37fb02ce1197a08abfda7eff026c20 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

module Types
  class ShaFormatEnum < BaseEnum
    graphql_name 'ShaFormat'
    description 'How to format SHA strings.'

    FORMATS_DESCRIPTION = {
      short: 'Abbreviated format. Short SHAs are typically eight characters long.',
      long: 'Unabbreviated format.'
    }.freeze

    FORMATS_DESCRIPTION.each do |format, description|
      value format.to_s.upcase,
            description: description,
            value: format.to_s
    end
  end
end