Class: LeastUsedNode

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(execution_type:) ⇒ LeastUsedNode

Returns a new instance of LeastUsedNode.



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

def initialize(execution_type:)
  @execution_type = execution_type
end

Instance Attribute Details

#execution_typeObject (readonly)

Returns the value of attribute execution_type.



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

def execution_type
  @execution_type
end

Instance Method Details

#callObject



10
11
12
# File 'app/services/least_used_node.rb', line 10

def call
  least_used_nodes&.sample
end