Class: RubyRTF::Table::Row

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

Defined Under Namespace

Classes: Cell

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table) ⇒ Row

Returns a new instance of Row.



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

def initialize(table)
  @table = table
  @end_positions = []

  @cells = [RubyRTF::Table::Row::Cell.new(self, 0)]
end

Instance Attribute Details

#cellsObject

Returns the value of attribute cells.



23
24
25
# File 'lib/ruby-rtf/table.rb', line 23

def cells
  @cells
end

#end_positionsObject

Returns the value of attribute end_positions.



23
24
25
# File 'lib/ruby-rtf/table.rb', line 23

def end_positions
  @end_positions
end

#tableObject

Returns the value of attribute table.



23
24
25
# File 'lib/ruby-rtf/table.rb', line 23

def table
  @table
end

Instance Method Details

#add_cellObject



36
37
38
39
40
41
# File 'lib/ruby-rtf/table.rb', line 36

def add_cell
  return @cells.last if @cells.last.sections.empty?

  @cells << RubyRTF::Table::Row::Cell.new(self, @cells.length)
  @cells.last
end

#current_cellObject



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

def current_cell
  @cells.last
end