Class: RubyRTF::Table

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

Defined Under Namespace

Classes: Row

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTable

Returns a new instance of Table.



5
6
7
8
9
10
11
# File 'lib/ruby-rtf/table.rb', line 5

def initialize
  @left_margin = 0
  @half_gap = 0

  @rows = []
  add_row
end

Instance Attribute Details

#half_gapObject

Returns the value of attribute half_gap.



3
4
5
# File 'lib/ruby-rtf/table.rb', line 3

def half_gap
  @half_gap
end

#left_marginObject

Returns the value of attribute left_margin.



3
4
5
# File 'lib/ruby-rtf/table.rb', line 3

def left_margin
  @left_margin
end

#rowsObject

Returns the value of attribute rows.



3
4
5
# File 'lib/ruby-rtf/table.rb', line 3

def rows
  @rows
end

Instance Method Details

#add_rowObject



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

def add_row
  @rows << RubyRTF::Table::Row.new(self)
  @rows.last
end

#current_rowObject



13
14
15
# File 'lib/ruby-rtf/table.rb', line 13

def current_row
  @rows.last
end