Class: AdjustExecutionTypeSlots
- Inherits:
-
Object
- Object
- AdjustExecutionTypeSlots
- Defined in:
- app/services/adjust_execution_type_slots.rb
Instance Attribute Summary collapse
-
#execution_type ⇒ Object
readonly
Returns the value of attribute execution_type.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Instance Method Summary collapse
- #decrement? ⇒ Boolean
- #increment? ⇒ Boolean
-
#initialize(node:, execution_type:) ⇒ AdjustExecutionTypeSlots
constructor
A new instance of AdjustExecutionTypeSlots.
- #perform ⇒ Object
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_type ⇒ Object (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 |
#node ⇒ Object (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
23 24 25 |
# File 'app/services/adjust_execution_type_slots.rb', line 23 def decrement? amount < count_by_execution_type end |
#increment? ⇒ Boolean
19 20 21 |
# File 'app/services/adjust_execution_type_slots.rb', line 19 def increment? amount > count_by_execution_type end |
#perform ⇒ Object
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 |