Class: Ace::Overseer::Models::PruneCandidate
- Inherits:
-
Object
- Object
- Ace::Overseer::Models::PruneCandidate
- Defined in:
- lib/ace/overseer/models/prune_candidate.rb
Instance Attribute Summary collapse
-
#assignment_complete ⇒ Object
readonly
Returns the value of attribute assignment_complete.
-
#git_clean ⇒ Object
readonly
Returns the value of attribute git_clean.
-
#reasons ⇒ Object
readonly
Returns the value of attribute reasons.
-
#task_done ⇒ Object
readonly
Returns the value of attribute task_done.
-
#task_id ⇒ Object
readonly
Returns the value of attribute task_id.
-
#worktree_path ⇒ Object
readonly
Returns the value of attribute worktree_path.
Instance Method Summary collapse
-
#initialize(task_id:, worktree_path:, assignment_complete:, task_done:, git_clean:, reasons: []) ⇒ PruneCandidate
constructor
A new instance of PruneCandidate.
- #safe_to_prune? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(task_id:, worktree_path:, assignment_complete:, task_done:, git_clean:, reasons: []) ⇒ PruneCandidate
Returns a new instance of PruneCandidate.
9 10 11 12 13 14 15 16 |
# File 'lib/ace/overseer/models/prune_candidate.rb', line 9 def initialize(task_id:, worktree_path:, assignment_complete:, task_done:, git_clean:, reasons: []) @task_id = task_id.to_s.freeze @worktree_path = worktree_path.to_s.freeze @assignment_complete = assignment_complete @task_done = task_done @git_clean = git_clean @reasons = reasons.map(&:to_s).freeze end |
Instance Attribute Details
#assignment_complete ⇒ Object (readonly)
Returns the value of attribute assignment_complete.
7 8 9 |
# File 'lib/ace/overseer/models/prune_candidate.rb', line 7 def assignment_complete @assignment_complete end |
#git_clean ⇒ Object (readonly)
Returns the value of attribute git_clean.
7 8 9 |
# File 'lib/ace/overseer/models/prune_candidate.rb', line 7 def git_clean @git_clean end |
#reasons ⇒ Object (readonly)
Returns the value of attribute reasons.
7 8 9 |
# File 'lib/ace/overseer/models/prune_candidate.rb', line 7 def reasons @reasons end |
#task_done ⇒ Object (readonly)
Returns the value of attribute task_done.
7 8 9 |
# File 'lib/ace/overseer/models/prune_candidate.rb', line 7 def task_done @task_done end |
#task_id ⇒ Object (readonly)
Returns the value of attribute task_id.
7 8 9 |
# File 'lib/ace/overseer/models/prune_candidate.rb', line 7 def task_id @task_id end |
#worktree_path ⇒ Object (readonly)
Returns the value of attribute worktree_path.
7 8 9 |
# File 'lib/ace/overseer/models/prune_candidate.rb', line 7 def worktree_path @worktree_path end |
Instance Method Details
#safe_to_prune? ⇒ Boolean
18 19 20 |
# File 'lib/ace/overseer/models/prune_candidate.rb', line 18 def safe_to_prune? assignment_complete && task_done && git_clean end |
#to_h ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/ace/overseer/models/prune_candidate.rb', line 22 def to_h { task_id: task_id, worktree_path: worktree_path, assignment_complete: assignment_complete, task_done: task_done, git_clean: git_clean, reasons: reasons, safe_to_prune: safe_to_prune? } end |