lib/conceptql/graph_nodifier.rb in conceptql-0.0.6 vs lib/conceptql/graph_nodifier.rb in conceptql-0.0.7
- old
+ new
@@ -124,34 +124,16 @@
options.values
end
end
class DefineNode < DotNode
- def initialize(*args)
- @gn = args.pop
- super(*args)
- end
-
- def types
- @gn.types[namify(arguments.first)] = super
- end
-
def shape
:cds
end
end
class RecallNode < DotNode
- def initialize(*args)
- @gn = args.pop
- super(*args)
- end
-
- def types
- @gn.types[namify(arguments.first)]
- end
-
def shape
:cds
end
end
@@ -174,12 +156,12 @@
def create(type, values, tree)
if BINARY_OPERATOR_TYPES.include?(type)
return BinaryOperatorNode.new(type, values)
elsif type == :define
- return DefineNode.new(type, values, self)
+ return DefineNode.new(type, values).tap { |n| n.tree = self }
elsif type == :recall
- return RecallNode.new(type, values, self)
+ return RecallNode.new(type, values).tap { |n| n.tree = self }
elsif type == :vsac
types = values.pop
return VsacNode.new(type, values, types)
end
DotNode.new(type, values)