Class: Agentilda::Adoption::Adoptee

Inherits:
Data
  • Object
show all
Defined in:
lib/agentilda/adoption.rb

Overview

One pull request and the plan it is being given.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#majorInteger (readonly)

Returns the furthest plan its branch or diff could see.

Returns:

  • (Integer)

    the furthest plan its branch or diff could see



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/agentilda/adoption.rb', line 42

Adoptee = Data.define(:pull, :ordinal, :major, :path) do
  # @return [String] the folder name this pull request earns
  def dirname = Agentilda.plan_dirname(ordinal, STATUS_BY_KEY.fetch(:retroactive), slug)

  # The PR title, stripped of any prefix, as the folder's tail.
  #
  # @return [String]
  def slug = Creator.slugify(pull[:title].to_s.sub(/\A\[[^\]]+\](?:\([A-Z]\))?\s*/, ""))

  # @return [String] a single auditable line
  def to_s = "##{pull[:number]}#{dirname}"
end

#ordinalAgentilda::Ordinal (readonly)

Returns the slot it was allocated.

Returns:



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/agentilda/adoption.rb', line 42

Adoptee = Data.define(:pull, :ordinal, :major, :path) do
  # @return [String] the folder name this pull request earns
  def dirname = Agentilda.plan_dirname(ordinal, STATUS_BY_KEY.fetch(:retroactive), slug)

  # The PR title, stripped of any prefix, as the folder's tail.
  #
  # @return [String]
  def slug = Creator.slugify(pull[:title].to_s.sub(/\A\[[^\]]+\](?:\([A-Z]\))?\s*/, ""))

  # @return [String] a single auditable line
  def to_s = "##{pull[:number]}#{dirname}"
end

#pathString? (readonly)

Returns the folder, once created.

Returns:

  • (String, nil)

    the folder, once created



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/agentilda/adoption.rb', line 42

Adoptee = Data.define(:pull, :ordinal, :major, :path) do
  # @return [String] the folder name this pull request earns
  def dirname = Agentilda.plan_dirname(ordinal, STATUS_BY_KEY.fetch(:retroactive), slug)

  # The PR title, stripped of any prefix, as the folder's tail.
  #
  # @return [String]
  def slug = Creator.slugify(pull[:title].to_s.sub(/\A\[[^\]]+\](?:\([A-Z]\))?\s*/, ""))

  # @return [String] a single auditable line
  def to_s = "##{pull[:number]}#{dirname}"
end

#pullHash (readonly)

Returns as returned by GitHub#pulls.

Returns:



42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/agentilda/adoption.rb', line 42

Adoptee = Data.define(:pull, :ordinal, :major, :path) do
  # @return [String] the folder name this pull request earns
  def dirname = Agentilda.plan_dirname(ordinal, STATUS_BY_KEY.fetch(:retroactive), slug)

  # The PR title, stripped of any prefix, as the folder's tail.
  #
  # @return [String]
  def slug = Creator.slugify(pull[:title].to_s.sub(/\A\[[^\]]+\](?:\([A-Z]\))?\s*/, ""))

  # @return [String] a single auditable line
  def to_s = "##{pull[:number]}#{dirname}"
end

Instance Method Details

#dirnameString

Returns the folder name this pull request earns.

Returns:

  • (String)

    the folder name this pull request earns



44
# File 'lib/agentilda/adoption.rb', line 44

def dirname = Agentilda.plan_dirname(ordinal, STATUS_BY_KEY.fetch(:retroactive), slug)

#slugString

The PR title, stripped of any prefix, as the folder's tail.

Returns:

  • (String)


49
# File 'lib/agentilda/adoption.rb', line 49

def slug = Creator.slugify(pull[:title].to_s.sub(/\A\[[^\]]+\](?:\([A-Z]\))?\s*/, ""))

#to_sString

Returns a single auditable line.

Returns:

  • (String)

    a single auditable line



52
# File 'lib/agentilda/adoption.rb', line 52

def to_s = "##{pull[:number]}#{dirname}"