class Tengine::Job::Runtime::Vertex
Edgeとともにジョブネットを構成するグラフの「頂点」を表すモデルです。 このクラスだけでツリー構造を作ることができますが、ほぼ抽象クラスであり実際には 派生クラスのオブジェクトによってツリー構造が作られます。
Public Instance Methods
ancestors_until_expansion()
click to toggle source
# File lib/tengine/job/runtime/vertex.rb, line 36 def ancestors_until_expansion if parent = self.parent parent.ancestors_until_expansion + [parent] else [] end end
next_edges()
click to toggle source
# File lib/tengine/job/runtime/vertex.rb, line 31 def next_edges return nil unless parent parent.edges.select{|edge| edge.origin_id == self.id} end
previous_edges()
click to toggle source
# File lib/tengine/job/runtime/vertex.rb, line 25 def previous_edges return nil unless parent parent.edges.select{|edge| edge.destination_id == self.id} end
Also aliased as: prev_edges
runtime?()
click to toggle source
# File lib/tengine/job/runtime/vertex.rb, line 23 def runtime?; !template?; end
save_descendants!()
click to toggle source
Tengine::Job::Runtime::Vertexは構成されるツリーのルートを保存しても、embedでないので 各vertexをsaveしないと保存されないため、明示的に保存しています。
# File lib/tengine/job/runtime/vertex.rb, line 46 def save_descendants! accept_visitor(Tengine::Job::Structure::Visitor::All.new{|v| v.save! }) end
template?()
click to toggle source
# File lib/tengine/job/runtime/vertex.rb, line 22 def template?; false; end