Sha256: 696373a7040fb9ed687e50581fc2a1cbe919d8503c92c1cb2087b1464314843b
Contents?: true
Size: 912 Bytes
Versions: 47
Compression:
Stored size: 912 Bytes
Contents
# frozen_string_literal: true require_relative 'base' require_relative 'label' require 'date' require 'time' module Gitlab module Triage module Resource class LabelEvent < Base FIELDS = %i[ id user resource_type resource_id action ].freeze TIME_FIELDS = %i[ created_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 def label return unless resource[:label] @label ||= Label.new( resource[:label].reverse_merge(added_at: resource[:created_at]), parent: self) end end end end end
Version data entries
47 entries across 47 versions & 2 rubygems