Class: CallGraph::Printers::Png

Inherits:
Object
  • Object
show all
Defined in:
lib/call_graph/printers/png.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Png

Returns a new instance of Png.



6
7
8
# File 'lib/call_graph/printers/png.rb', line 6

def initialize(config)
  @config = config
end

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



4
5
6
# File 'lib/call_graph/printers/png.rb', line 4

def config
  @config
end

Instance Method Details

#to_sObject



10
11
12
13
14
15
16
# File 'lib/call_graph/printers/png.rb', line 10

def to_s
  unless `which dot`.empty?
    `dot -Tpng #{src}`
  else
    raise 'Error: unable to find dot executable in $PATH'
  end
end