Class: ConceptQL::GraphNodifier::BinaryOperatorOperator

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

Constant Summary

Constants inherited from DotOperator

DotOperator::TYPES

Constants included from Behaviors::Dottable

Behaviors::Dottable::TYPE_COLORS

Constants inherited from Operators::Operator

Operators::Operator::COLUMNS

Instance Attribute Summary

Attributes inherited from DotOperator

#values

Attributes inherited from Operators::Operator

#options, #upstreams, #values

Instance Method Summary collapse

Methods inherited from DotOperator

#initialize

Methods included from Behaviors::Dottable

#graph_operator, #link_to, #my_count, #my_n, #operator_name, #operator_number, #reset_operator_number, #type_color

Methods inherited from Operators::Operator

#columns, #evaluate, #initialize, #label, #select_it, #set_values, #sql, #stream

Methods included from Metadatable

#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

Constructor Details

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

Instance Method Details

#argumentsObject



128
129
130
# File 'lib/conceptql/graph_nodifier.rb', line 128

def arguments
  options.values
end

#display_nameObject



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_optionsObject



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

#leftObject



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

def left
  options[:left]
end

#rightObject



106
107
108
# File 'lib/conceptql/graph_nodifier.rb', line 106

def right
  options[:right]
end

#typesObject



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

def types
  left.types
end