Class: ConceptQL::GraphNodifier::BinaryOperatorNode

Inherits:
DotNode show all
Defined in:
lib/conceptql/graph_nodifier.rb

Constant Summary

Constants inherited from DotNode

DotNode::TYPES

Constants included from Behaviors::Dottable

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

Methods included from Behaviors::Dottable

#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

Constructor Details

This class inherits a constructor from ConceptQL::GraphNodifier::DotNode

Instance Method Details

#argumentsObject



123
124
125
# File 'lib/conceptql/graph_nodifier.rb', line 123

def arguments
  options.values
end

#display_nameObject



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_optionsObject



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

#leftObject



97
98
99
# File 'lib/conceptql/graph_nodifier.rb', line 97

def left
  options[:left]
end

#rightObject



101
102
103
# File 'lib/conceptql/graph_nodifier.rb', line 101

def right
  options[:right]
end

#typesObject



119
120
121
# File 'lib/conceptql/graph_nodifier.rb', line 119

def types
  left.types
end