Sha256: 94f52e4e3298c75d2aadfb50bff1f4dab0572674d8c565299474ea3453cc64d1

Contents?: true

Size: 658 Bytes

Versions: 11

Compression:

Stored size: 658 Bytes

Contents

module Gitlab
  module Triage
    module CommandBuilders
      class BaseCommandBuilder
        def initialize(items)
          @items = Array(items)
          @items.delete('')
        end

        def build_command
          if @items.any?
            [slash_command_string, content_string].compact.join(separator)
          else
            ""
          end
        end

        private

        def separator
          ' '
        end

        def slash_command_string
          nil
        end

        def content_string
          @items.map do |item|
            format_item(item)
          end.join(separator)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
gitlab-triage-0.14.1 lib/gitlab/triage/command_builders/base_command_builder.rb
gitlab-triage-0.14.0 lib/gitlab/triage/command_builders/base_command_builder.rb
gitlab-triage-0.13.0 lib/gitlab/triage/command_builders/base_command_builder.rb
gitlab-triage-0.12.0 lib/gitlab/triage/command_builders/base_command_builder.rb
gitlab-triage-0.11.0 lib/gitlab/triage/command_builders/base_command_builder.rb
gitlab-triage-0.10.0 lib/gitlab/triage/command_builders/base_command_builder.rb
gitlab-triage-0.9.0 lib/gitlab/triage/command_builders/base_command_builder.rb
gitlab-triage-0.8.1 lib/gitlab/triage/command_builders/base_command_builder.rb
gitlab-triage-0.8.0 lib/gitlab/triage/command_builders/base_command_builder.rb
gitlab-triage-0.7.0 lib/gitlab/triage/command_builders/base_command_builder.rb
gitlab-triage-0.6.0 lib/gitlab/triage/command_builders/base_command_builder.rb