Class: FriendlyNameSlots

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node:) ⇒ FriendlyNameSlots

Returns a new instance of FriendlyNameSlots.



6
7
8
# File 'app/services/friendly_name_slots.rb', line 6

def initialize(node:)
  @node = node
end

Instance Attribute Details

#nodeObject (readonly)

Returns the value of attribute node.



4
5
6
# File 'app/services/friendly_name_slots.rb', line 4

def node
  @node
end

Instance Method Details

#performObject



10
11
12
13
14
# File 'app/services/friendly_name_slots.rb', line 10

def perform
  node.slots.each_with_index do |slot, index|
    slot.update(name: "#{node.name}-s#{format("%02d", (index + 1))}-#{slot.execution_type}")
  end
end