Class: LockSlot
- Inherits:
-
Object
- Object
- LockSlot
- Defined in:
- app/services/lock_slot.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
-
#initialize(execution_type:, node: nil) ⇒ LockSlot
constructor
A new instance of LockSlot.
- #perform ⇒ Object
Constructor Details
#initialize(execution_type:, node: nil) ⇒ LockSlot
Returns a new instance of LockSlot.
6 7 8 9 |
# File 'app/services/lock_slot.rb', line 6 def initialize(execution_type:, node: nil) @execution_type = execution_type @node = node end |
Instance Attribute Details
#execution_type ⇒ Object (readonly)
Returns the value of attribute execution_type.
4 5 6 |
# File 'app/services/lock_slot.rb', line 4 def execution_type @execution_type end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
4 5 6 |
# File 'app/services/lock_slot.rb', line 4 def node @node end |
Instance Method Details
#perform ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'app/services/lock_slot.rb', line 11 def perform return unless selected_node selected_node .slots .available .where(execution_type: execution_type) .find_one_and_update( { "$set" => { status: "attaching" } }, return_document: :after ) end |