Class: AdjustExecutionTypeSlots

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(node:, execution_type:) ⇒ AdjustExecutionTypeSlots

Returns a new instance of AdjustExecutionTypeSlots.



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

def initialize(node:, execution_type:)
  @node = node
  @execution_type = execution_type
end

Instance Attribute Details

#execution_typeObject (readonly)

Returns the value of attribute execution_type.



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

def execution_type
  @execution_type
end

#nodeObject (readonly)

Returns the value of attribute node.



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

def node
  @node
end

Instance Method Details

#decrement?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'app/services/adjust_execution_type_slots.rb', line 23

def decrement?
  amount < count_by_execution_type
end

#increment?Boolean

Returns:

  • (Boolean)


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

def increment?
  amount > count_by_execution_type
end

#performObject



11
12
13
14
15
16
17
# File 'app/services/adjust_execution_type_slots.rb', line 11

def perform
  increment_slots

  decrement_slots

  FriendlyNameSlots.new(node: node).perform
end