Class: Ace::Overseer::Models::AssignmentPruneCandidate
- Inherits:
-
Object
- Object
- Ace::Overseer::Models::AssignmentPruneCandidate
- Defined in:
- lib/ace/overseer/models/assignment_prune_candidate.rb
Instance Attribute Summary collapse
-
#assignment_id ⇒ Object
readonly
Returns the value of attribute assignment_id.
-
#assignment_name ⇒ Object
readonly
Returns the value of attribute assignment_name.
-
#assignment_state ⇒ Object
readonly
Returns the value of attribute assignment_state.
-
#location_path ⇒ Object
readonly
Returns the value of attribute location_path.
-
#reasons ⇒ Object
readonly
Returns the value of attribute reasons.
Instance Method Summary collapse
-
#initialize(assignment_id:, assignment_name:, assignment_state:, location_path:, reasons: []) ⇒ AssignmentPruneCandidate
constructor
A new instance of AssignmentPruneCandidate.
- #safe_to_prune? ⇒ Boolean
- #to_h ⇒ Object
Constructor Details
#initialize(assignment_id:, assignment_name:, assignment_state:, location_path:, reasons: []) ⇒ AssignmentPruneCandidate
Returns a new instance of AssignmentPruneCandidate.
9 10 11 12 13 14 15 |
# File 'lib/ace/overseer/models/assignment_prune_candidate.rb', line 9 def initialize(assignment_id:, assignment_name:, assignment_state:, location_path:, reasons: []) @assignment_id = assignment_id.to_s.freeze @assignment_name = assignment_name.to_s.freeze @assignment_state = assignment_state.to_s.freeze @location_path = location_path.to_s.freeze @reasons = reasons.map(&:to_s).freeze end |
Instance Attribute Details
#assignment_id ⇒ Object (readonly)
Returns the value of attribute assignment_id.
7 8 9 |
# File 'lib/ace/overseer/models/assignment_prune_candidate.rb', line 7 def assignment_id @assignment_id end |
#assignment_name ⇒ Object (readonly)
Returns the value of attribute assignment_name.
7 8 9 |
# File 'lib/ace/overseer/models/assignment_prune_candidate.rb', line 7 def assignment_name @assignment_name end |
#assignment_state ⇒ Object (readonly)
Returns the value of attribute assignment_state.
7 8 9 |
# File 'lib/ace/overseer/models/assignment_prune_candidate.rb', line 7 def assignment_state @assignment_state end |
#location_path ⇒ Object (readonly)
Returns the value of attribute location_path.
7 8 9 |
# File 'lib/ace/overseer/models/assignment_prune_candidate.rb', line 7 def location_path @location_path end |
#reasons ⇒ Object (readonly)
Returns the value of attribute reasons.
7 8 9 |
# File 'lib/ace/overseer/models/assignment_prune_candidate.rb', line 7 def reasons @reasons end |
Instance Method Details
#safe_to_prune? ⇒ Boolean
17 18 19 |
# File 'lib/ace/overseer/models/assignment_prune_candidate.rb', line 17 def safe_to_prune? assignment_state == "completed" end |
#to_h ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/ace/overseer/models/assignment_prune_candidate.rb', line 21 def to_h { assignment_id: assignment_id, assignment_name: assignment_name, assignment_state: assignment_state, location_path: location_path, reasons: reasons, safe_to_prune: safe_to_prune? } end |