Class: Agentilda::Adoption::Adoptee
- Inherits:
-
Data
- Object
- Data
- Agentilda::Adoption::Adoptee
- Defined in:
- lib/agentilda/adoption.rb
Overview
One pull request and the plan it is being given.
Instance Attribute Summary collapse
-
#major ⇒ Integer
readonly
The furthest plan its branch or diff could see.
-
#ordinal ⇒ Agentilda::Ordinal
readonly
The slot it was allocated.
-
#path ⇒ String?
readonly
The folder, once created.
-
#pull ⇒ Hash
readonly
As returned by GitHub#pulls.
Instance Method Summary collapse
-
#dirname ⇒ String
The folder name this pull request earns.
-
#slug ⇒ String
The PR title, stripped of any prefix, as the folder's tail.
-
#to_s ⇒ String
A single auditable line.
Instance Attribute Details
#major ⇒ Integer (readonly)
Returns 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 |
#ordinal ⇒ Agentilda::Ordinal (readonly)
Returns the slot it was allocated.
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 |
#path ⇒ String? (readonly)
Returns 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 |
#pull ⇒ Hash (readonly)
Returns as returned by GitHub#pulls.
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
#dirname ⇒ String
Returns 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) |
#slug ⇒ String
The PR title, stripped of any prefix, as the folder's tail.
49 |
# File 'lib/agentilda/adoption.rb', line 49 def slug = Creator.slugify(pull[:title].to_s.sub(/\A\[[^\]]+\](?:\([A-Z]\))?\s*/, "")) |
#to_s ⇒ String
Returns a single auditable line.
52 |
# File 'lib/agentilda/adoption.rb', line 52 def to_s = "##{pull[:number]} → #{dirname}" |