Sha256: ff1d8664eaca32f4b34f6f378082b7b96e8f2cae4db55080ad90776408e7d937
Contents?: true
Size: 1.04 KB
Versions: 4
Compression:
Stored size: 1.04 KB
Contents
require_relative 'node' module ConceptQL module Nodes # Base class for all nodes that take two streams, a left-hand and a right-hand class BinaryOperatorNode < Node def children [left] end def graph_it(g, db) left.graph_it(g, db) right.graph_it(g, db) cluster_name = "cluster_#{node_name}" me = g.send(cluster_name) do |sub| sub[rank: 'same', label: display_name, color: 'black'] sub.send("#{cluster_name}_left").send('[]', shape: 'point', color: type_color(types)) sub.send("#{cluster_name}_right").send('[]', shape: 'point') end left.link_to(g, me.send("#{cluster_name}_left")) right.link_to(g, me.send("#{cluster_name}_right")) @__graph_node = me.send("#{cluster_name}_left") end def display_name self.class.name.split('::').last.titleize end private def left @left ||= options[:left] end def right @right ||= options[:right] end end end end
Version data entries
4 entries across 4 versions & 1 rubygems