Class: RubyRTF::Document

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-rtf/document.rb

Overview

Represents the entire RTF document

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRubyRTF::Document

Creates a new document



23
24
25
26
27
28
29
30
# File 'lib/ruby-rtf/document.rb', line 23

def initialize
  @font_table = []
  @colour_table = []
  @character_set = :ansi
  @default_font = 0

  @sections = []
end

Instance Attribute Details

#character_setString

Returns The characgter set for the document (:ansi, :pc, :pca, :mac).

Returns:

  • (String)

    The characgter set for the document (:ansi, :pc, :pca, :mac)



15
16
17
# File 'lib/ruby-rtf/document.rb', line 15

def character_set
  @character_set
end

#colour_tableArray (readonly) Also known as: color_table

Returns The colour table.

Returns:

  • (Array)

    The colour table



8
9
10
# File 'lib/ruby-rtf/document.rb', line 8

def colour_table
  @colour_table
end

#default_fontInteger

Returns The default font number for the document.

Returns:

  • (Integer)

    The default font number for the document



12
13
14
# File 'lib/ruby-rtf/document.rb', line 12

def default_font
  @default_font
end

#font_tableArray (readonly)

Returns The font table.

Returns:

  • (Array)

    The font table



5
6
7
# File 'lib/ruby-rtf/document.rb', line 5

def font_table
  @font_table
end

#sectionsArray (readonly)

Returns The different formatted sections of the document.

Returns:

  • (Array)

    The different formatted sections of the document



18
19
20
# File 'lib/ruby-rtf/document.rb', line 18

def sections
  @sections
end

Instance Method Details

#<<(obj) ⇒ Object



32
33
34
# File 'lib/ruby-rtf/document.rb', line 32

def <<(obj)
  @sections << obj
end