Class: FriendlyNameSlots
- Inherits:
-
Object
- Object
- FriendlyNameSlots
- Defined in:
- app/services/friendly_name_slots.rb
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
-
#initialize(node:) ⇒ FriendlyNameSlots
constructor
A new instance of FriendlyNameSlots.
- #perform ⇒ Object
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
#node ⇒ Object (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
#perform ⇒ Object
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 |