Class: CheckForSlotRemoval
- Inherits:
-
Object
- Object
- CheckForSlotRemoval
- Defined in:
- app/services/check_for_slot_removal.rb
Instance Attribute Summary collapse
-
#slot ⇒ Object
readonly
Returns the value of attribute slot.
Instance Method Summary collapse
-
#initialize(slot:) ⇒ CheckForSlotRemoval
constructor
A new instance of CheckForSlotRemoval.
- #perform ⇒ Object
- #removed? ⇒ Boolean
Constructor Details
#initialize(slot:) ⇒ CheckForSlotRemoval
Returns a new instance of CheckForSlotRemoval.
6 7 8 |
# File 'app/services/check_for_slot_removal.rb', line 6 def initialize(slot:) @slot = slot end |
Instance Attribute Details
#slot ⇒ Object (readonly)
Returns the value of attribute slot.
4 5 6 |
# File 'app/services/check_for_slot_removal.rb', line 4 def slot @slot end |
Instance Method Details
#perform ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'app/services/check_for_slot_removal.rb', line 10 def perform return unless adjust_execution_type_slots_instance.decrement? slot.destroy! FriendlyNameSlots.new(node: slot.node.reload).perform @removed = true end |
#removed? ⇒ Boolean
19 20 21 |
# File 'app/services/check_for_slot_removal.rb', line 19 def removed? @removed end |