Class: HostConnect::RtfDocument

Inherits:
Object
  • Object
show all
Defined in:
lib/hostconnect/rtf_document.rb

Overview

For setting up simple RTF Documents

Instance Method Summary collapse

Constructor Details

#initialize(paragraphs) ⇒ RtfDocument

Returns a new instance of RtfDocument.



4
5
6
7
8
9
# File 'lib/hostconnect/rtf_document.rb', line 4

def initialize(paragraphs)
  @document = RTF::Document.new(RTF::Font.new(RTF::Font::ROMAN, 'Times New Roman'))
  paragraphs.each do |p|
    @document.paragraph << p
  end
end

Instance Method Details

#to_rtfObject



11
12
13
# File 'lib/hostconnect/rtf_document.rb', line 11

def to_rtf
  @document.to_rtf
end

#to_sObject



15
16
17
# File 'lib/hostconnect/rtf_document.rb', line 15

def to_s
  @document.to_s
end