Allow passing through file extensions to graph

Still defaults to png.
This commit is contained in:
Graham Conzett
2014-02-03 14:30:05 -05:00
parent 66e57b9ace
commit 1f871cbad5

View File

@@ -131,10 +131,10 @@ module DecisionTree
descend(@tree, test)
end
def graph(filename)
def graph(filename, file_type = "png")
require 'graphr'
dgp = DotGraphPrinter.new(build_tree)
dgp.write_to_file("#{filename}.png", "png")
dgp.write_to_file("#{filename}.#{file_type}", file_type)
end
def ruleset