Class: CheckForSlotRemoval

Inherits:
Object
  • Object
show all
Defined in:
app/services/check_for_slot_removal.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#slotObject (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

#performObject



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

Returns:

  • (Boolean)


19
20
21
# File 'app/services/check_for_slot_removal.rb', line 19

def removed?
  @removed
end