Class: RTFtoPDF::RTF

Inherits:
Object
  • Object
show all
Defined in:
lib/rtftopdf/rtf.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contentObject

Returns the value of attribute content.



5
6
7
# File 'lib/rtftopdf/rtf.rb', line 5

def content
  @content
end

Class Method Details

.parse(content) ⇒ Object



7
8
9
10
11
# File 'lib/rtftopdf/rtf.rb', line 7

def self.parse content
  rtf = new
  rtf.content = content
  rtf
end

Instance Method Details

#to_htmlObject



13
14
15
16
17
# File 'lib/rtftopdf/rtf.rb', line 13

def to_html
  TemporaryFile.within_a_file(content) do |file|
    `unrtf #{file.path}`
  end
end