Class: GFM::Converter
- Inherits:
-
Object
- Object
- GFM::Converter
- Defined in:
- lib/gfm/converter.rb
Instance Attribute Summary collapse
-
#input_file_name ⇒ Object
readonly
Returns the value of attribute input_file_name.
-
#output_file_name ⇒ Object
readonly
Returns the value of attribute output_file_name.
Instance Method Summary collapse
-
#initialize(filename) ⇒ Converter
constructor
A new instance of Converter.
- #write_output_file(filename = nil) ⇒ Object
Constructor Details
#initialize(filename) ⇒ Converter
Returns a new instance of Converter.
6 7 8 |
# File 'lib/gfm/converter.rb', line 6 def initialize(filename) @input_file_name = filename end |
Instance Attribute Details
#input_file_name ⇒ Object (readonly)
Returns the value of attribute input_file_name.
3 4 5 |
# File 'lib/gfm/converter.rb', line 3 def input_file_name @input_file_name end |
#output_file_name ⇒ Object (readonly)
Returns the value of attribute output_file_name.
4 5 6 |
# File 'lib/gfm/converter.rb', line 4 def output_file_name @output_file_name end |
Instance Method Details
#write_output_file(filename = nil) ⇒ Object
10 11 12 13 |
# File 'lib/gfm/converter.rb', line 10 def write_output_file(filename = nil) @output_file_name = sanitized_output_file_name(filename) File.open(@output_file_name, 'w').write(html_content) end |