Class: Dynflow::Coordinator::PlanningLock

Inherits:
LockByWorld show all
Defined in:
lib/dynflow/coordinator.rb

Constant Summary

Constants inherited from Serializable

Serializable::LEGACY_TIME_FORMAT, Serializable::TIME_FORMAT

Instance Attribute Summary

Attributes inherited from Record

#data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from LockByWorld

inherited, unique_filter, valid_classes, valid_owner_ids, #validate!, #world_id

Methods inherited from Lock

constantize, #owner_id, #to_s, #validate!

Methods inherited from Record

#==, constantize, #from_hash, #hash, #id, new_from_hash, #to_hash, #to_s, #validate!

Methods inherited from Serializable

constantize, from_hash, new_from_hash, #to_hash

Constructor Details

#initialize(world, execution_plan_id) ⇒ PlanningLock

Returns a new instance of PlanningLock.



299
300
301
302
303
# File 'lib/dynflow/coordinator.rb', line 299

def initialize(world, execution_plan_id)
  super(world)
  @data.merge!(id: self.class.lock_id(execution_plan_id),
               execution_plan_id: execution_plan_id)
end

Class Method Details

.lock_id(execution_plan_id) ⇒ Object



305
306
307
# File 'lib/dynflow/coordinator.rb', line 305

def self.lock_id(execution_plan_id)
  'execution-plan:' + execution_plan_id
end

Instance Method Details

#execution_plan_idObject



309
310
311
# File 'lib/dynflow/coordinator.rb', line 309

def execution_plan_id
  @data[:execution_plan_id]
end