Permalink
Browse files

Issue #48

add_graph fails when passed a GraphViz object
  • Loading branch information...
1 parent cd2a1e2 commit 324b44f84ca0477d648a58e34bad4702ea609119 @glejeune committed Jul 2, 2012
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/graphviz.rb
View
@@ -260,6 +260,8 @@ def add_graph( xGraphName = nil, hOpts = {}, &block )
if xGraphName.kind_of?(GraphViz)
xGraphID = xGraphName.id
@hoGraphs[xGraphID] = xGraphName.clone
+ @hoGraphs[xGraphID].type = @oGraphType
+ @hoGraphs[xGraphID].pg = self
xGraphName = xGraphID
else
if xGraphName.kind_of?(Hash)
@@ -331,6 +333,9 @@ def add(h)
def type
@oGraphType
end
+ def type=(x) #:nodoc:
+ @oGraphType = x
+ end
#
# Get the number of graphs
@@ -702,6 +707,9 @@ def <<( oNode )
def pg #:nodoc:
@oParentGraph
end
+ def pg=(x) #:nodoc:
+ @oParentGraph = x
+ end
#
# Return the root graph

0 comments on commit 324b44f

Please sign in to comment.