class Abt::Providers::Devops::Path

Constants

BOARD_NAME_REGEX
ORGANIZATION_NAME_REGEX
PATH_REGEX
PROJECT_NAME_REGEX
TEAM_NAME_REGEX
WORK_ITEM_ID_REGEX

Public Class Methods

from_ids(organization_name: nil, project_name: nil, team_name: nil, board_name: nil, work_item_id: nil) click to toggle source
# File lib/abt/providers/devops/path.rb, line 16
def self.from_ids(organization_name: nil, project_name: nil, team_name: nil, board_name: nil, work_item_id: nil)
  return new unless organization_name && project_name

  parts = [organization_name, project_name]

  if team_name
    parts << team_name

    if board_name
      parts << board_name
      parts << work_item_id if work_item_id
    end
  end

  new(parts.join("/"))
end
new(path = "") click to toggle source
Calls superclass method
# File lib/abt/providers/devops/path.rb, line 33
def initialize(path = "")
  raise Abt::Cli::Abort, "Invalid path: #{path}" unless PATH_REGEX.match?(path)

  super
end

Public Instance Methods

board_name() click to toggle source
# File lib/abt/providers/devops/path.rb, line 51
def board_name
  match[:board_name]
end
organization_name() click to toggle source
# File lib/abt/providers/devops/path.rb, line 39
def organization_name
  match[:organization_name]
end
project_name() click to toggle source
# File lib/abt/providers/devops/path.rb, line 43
def project_name
  match[:project_name]
end
team_name() click to toggle source
# File lib/abt/providers/devops/path.rb, line 47
def team_name
  match[:team_name]
end
work_item_id() click to toggle source
# File lib/abt/providers/devops/path.rb, line 55
def work_item_id
  match[:work_item_id]
end

Private Instance Methods

match() click to toggle source
# File lib/abt/providers/devops/path.rb, line 61
def match
  @match ||= PATH_REGEX.match(to_s)
end