Class: RTF
- Inherits:
-
Object
- Object
- RTF
- Defined in:
- lib/rtftopdf.rb
Instance Method Summary collapse
-
#initialize(rtf_content) ⇒ RTF
constructor
A new instance of RTF.
- #to_html ⇒ Object
Constructor Details
#initialize(rtf_content) ⇒ RTF
Returns a new instance of RTF.
6 7 8 |
# File 'lib/rtftopdf.rb', line 6 def initialize rtf_content @rtf_content = rtf_content end |
Instance Method Details
#to_html ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rtftopdf.rb', line 10 def to_html temporary_rtf_file = Tempfile.new('RTF') temporary_rtf_file.write(@rtf_content) temporary_rtf_file.close html_content = `unrtf #{temporary_rtf_file.path}` temporary_rtf_file.unlink html_content end |