Class: DepsGrapher::HtmlWriter
- Inherits:
-
Object
- Object
- DepsGrapher::HtmlWriter
- Defined in:
- lib/deps_grapher/html_writer.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(output_dir) ⇒ HtmlWriter
constructor
A new instance of HtmlWriter.
- #write(content) ⇒ Object
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
#path ⇒ Object (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 |