Sha256: 7b74f6a71529a933cf03283383606ea55cb812af0a6371f42ba323030e3b56e1

Contents?: true

Size: 706 Bytes

Versions: 22

Compression:

Stored size: 706 Bytes

Contents

# frozen_string_literal: true

require_relative 'base'
require 'date'
require 'time'

module Gitlab
  module Triage
    module Resource
      class Label < Base
        FIELDS = %i[
          id
          project_id
          group_id
          name
          description
          color
          priority
        ].freeze

        TIME_FIELDS = %i[
          added_at
        ].freeze

        FIELDS.each do |field|
          define_field(field) do
            resource[field]
          end
        end

        TIME_FIELDS.each do |field|
          define_field(field) do
            value = resource[field]

            Time.parse(value) if value
          end
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
gitlab-triage-1.10.1 lib/gitlab/triage/resource/label.rb
gitlab-triage-1.10.0 lib/gitlab/triage/resource/label.rb
gitlab-triage-1.9.0 lib/gitlab/triage/resource/label.rb
gitlab-triage-1.8.0 lib/gitlab/triage/resource/label.rb
gitlab-triage-1.7.1 lib/gitlab/triage/resource/label.rb
gitlab-triage-1.7.0 lib/gitlab/triage/resource/label.rb
gitlab-triage-1.6.1 lib/gitlab/triage/resource/label.rb
gitlab-triage-1.6.0 lib/gitlab/triage/resource/label.rb
gitlab-triage-1.5.1 lib/gitlab/triage/resource/label.rb
gitlab-triage-1.5.0 lib/gitlab/triage/resource/label.rb
gitlab-triage-1.4.2 lib/gitlab/triage/resource/label.rb
gitlab-triage-1.4.1 lib/gitlab/triage/resource/label.rb
gitlab-triage-1.4.0 lib/gitlab/triage/resource/label.rb
gitlab-triage-1.3.0 lib/gitlab/triage/resource/label.rb
gitlab-triage-1.2.0 lib/gitlab/triage/resource/label.rb
gitlab-triage-1.1.1 lib/gitlab/triage/resource/label.rb
gitlab-triage-1.1.0 lib/gitlab/triage/resource/label.rb
gitlab-triage-1.0.1 lib/gitlab/triage/resource/label.rb
gitlab-triage-1.0.0 lib/gitlab/triage/resource/label.rb
gitlab-triage-0.17.0 lib/gitlab/triage/resource/label.rb