Class: ConceptQL::GraphNodifier::BinaryOperatorNode
Constant Summary
Constants inherited
from DotNode
DotNode::TYPES
Behaviors::Dottable::TYPE_COLORS
Constants inherited
from Nodes::Node
Nodes::Node::COLUMNS
Instance Attribute Summary
Attributes inherited from DotNode
#values
Attributes inherited from Nodes::Node
#values
Instance Method Summary
collapse
Methods inherited from DotNode
#initialize
#graph_node, #link_to, #my_count, #my_n, #node_name, #type_color
Methods inherited from Nodes::Node
#children, #columns, #evaluate, #initialize, #select_it, #sql, #stream
Instance Method Details
#arguments ⇒ Object
123
124
125
|
# File 'lib/conceptql/graph_nodifier.rb', line 123
def arguments
options.values
end
|
#display_name ⇒ Object
87
88
89
90
91
|
# File 'lib/conceptql/graph_nodifier.rb', line 87
def display_name
output = name
output += "\n#{displayable_options.map{|k,v| "#{k}: #{v}"}.join("\n")}"
output
end
|
#displayable_options ⇒ Object
93
94
95
|
# File 'lib/conceptql/graph_nodifier.rb', line 93
def displayable_options
options.select{ |k,v| ![:left, :right].include?(k) } || {}
end
|
#graph_it(g, db) ⇒ Object
105
106
107
108
109
110
111
112
113
114
115
116
117
|
# File 'lib/conceptql/graph_nodifier.rb', line 105
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
|
#left ⇒ Object
97
98
99
|
# File 'lib/conceptql/graph_nodifier.rb', line 97
def left
options[:left]
end
|
#right ⇒ Object
101
102
103
|
# File 'lib/conceptql/graph_nodifier.rb', line 101
def right
options[:right]
end
|
#types ⇒ Object
119
120
121
|
# File 'lib/conceptql/graph_nodifier.rb', line 119
def types
left.types
end
|