Class: DepsGrapher::HtmlWriter

Inherits:
Object
  • Object
show all
Defined in:
lib/deps_grapher/html_writer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(output_dir) ⇒ HtmlWriter

Returns a new instance of HtmlWriter.



7
8
9
10
# File 'lib/deps_grapher/html_writer.rb', line 7

def initialize(output_dir)
  FileUtils.mkdir_p output_dir
  @path = File.join output_dir, "index.html"
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



5
6
7
# File 'lib/deps_grapher/html_writer.rb', line 5

def path
  @path
end

Instance Method Details

#write(content) ⇒ Object



12
13
14
# File 'lib/deps_grapher/html_writer.rb', line 12

def write(content)
  File.write path, content
end