Sha256: ec0060e365acac3b69f81a579d504c862399df028464f0639a4f604413044412
Contents?: true
Size: 1.32 KB
Versions: 20
Compression:
Stored size: 1.32 KB
Contents
# frozen_string_literal: true require_relative '../command_builders/text_content_builder' module Gitlab module Triage module EntityBuilders class IssueBuilder attr_reader :destination def initialize( type:, action:, resource:, network:, policy_spec: {}, separator: "\n") @type = type @policy_spec = policy_spec @item_template = action[:item] @title_template = action[:title] @description_template = action[:description] @destination = action[:destination] @redact_confidentials = action[:redact_confidential_resources] != false @resource = resource @network = network @separator = separator end def title @title ||= build_text(@title_template) end def description @description ||= build_text(@description_template) end def valid? title =~ /\S+/ end private def build_text(template) return '' unless template CommandBuilders::TextContentBuilder.new( template, resource: @resource, network: @network, redact_confidentials: @redact_confidentials) .build_command.chomp end end end end end
Version data entries
20 entries across 20 versions & 2 rubygems