Class: ConceptQL::Nodes::BinaryOperatorNode

Inherits:
Node
  • Object
show all
Defined in:
lib/conceptql/nodes/binary_operator_node.rb

Overview

Base class for all nodes that take two streams, a left-hand and a right-hand

Direct Known Subclasses

Except, PersonFilter, TemporalNode

Constant Summary

Constants inherited from Node

Node::KNOWN_TYPES

Instance Attribute Summary

Attributes inherited from Node

#values

Instance Method Summary collapse

Methods inherited from Node

#arguments, #columns, #date_columns, #evaluate, #initialize, #select_it, #stream, #types

Constructor Details

This class inherits a constructor from ConceptQL::Nodes::Node

Instance Method Details

#childrenObject



7
8
9
# File 'lib/conceptql/nodes/binary_operator_node.rb', line 7

def children
  [left]
end

#display_nameObject



25
26
27
# File 'lib/conceptql/nodes/binary_operator_node.rb', line 25

def display_name
  self.class.name.split('::').last.titleize
end

#graph_it(g, db) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/conceptql/nodes/binary_operator_node.rb', line 11

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