Class: ConceptQL::GraphNodifier::BinaryOperatorOperator
Constant Summary
Constants inherited
from DotOperator
DotOperator::TYPES
Behaviors::Dottable::TYPE_COLORS
Operators::Operator::COLUMNS
Instance Attribute Summary
Attributes inherited from DotOperator
#values
#options, #upstreams, #values
Instance Method Summary
collapse
Methods inherited from DotOperator
#initialize
#graph_operator, #link_to, #my_count, #my_n, #operator_name, #operator_number, #reset_operator_number, #type_color
#columns, #evaluate, #initialize, #label, #select_it, #set_values, #sql, #stream
#allows_many_upstreams, #allows_one_upstream, #argument, #category, #desc, #humanized_class_name, #inherited, #just_class_name, #option, #predominant_types, #preferred_name, #reset_categories, #to_metadata
Instance Method Details
#arguments ⇒ Object
128
129
130
|
# File 'lib/conceptql/graph_nodifier.rb', line 128
def arguments
options.values
end
|
#display_name ⇒ Object
92
93
94
95
96
|
# File 'lib/conceptql/graph_nodifier.rb', line 92
def display_name
output = name
output += "\n#{displayable_options.map{|k,v| "#{k}: #{v}"}.join("\n")}"
output
end
|
#displayable_options ⇒ Object
98
99
100
|
# File 'lib/conceptql/graph_nodifier.rb', line 98
def displayable_options
options.select{ |k,v| ![:left, :right].include?(k) } || {}
end
|
#graph_it(g, db) ⇒ Object
110
111
112
113
114
115
116
117
118
119
120
121
122
|
# File 'lib/conceptql/graph_nodifier.rb', line 110
def graph_it(g, db)
left.graph_it(g, db)
right.graph_it(g, db)
cluster_name = "cluster_#{operator_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_operator = me.send("#{cluster_name}_left")
end
|
#left ⇒ Object
102
103
104
|
# File 'lib/conceptql/graph_nodifier.rb', line 102
def left
options[:left]
end
|
#right ⇒ Object
106
107
108
|
# File 'lib/conceptql/graph_nodifier.rb', line 106
def right
options[:right]
end
|
#types ⇒ Object
124
125
126
|
# File 'lib/conceptql/graph_nodifier.rb', line 124
def types
left.types
end
|