Class: ODF::Row

Inherits:
Container show all
Defined in:
lib/odf/row.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Container

contains, create

Constructor Details

#initialize(number = 0, opts = {}) ⇒ Row

Returns a new instance of Row.



30
31
32
33
# File 'lib/odf/row.rb', line 30

def initialize(number=0, opts={})
  @number = number
  @style = opts[:style]
end

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



27
28
29
# File 'lib/odf/row.rb', line 27

def number
  @number
end

#style=(value) ⇒ Object (writeonly)

Sets the attribute style

Parameters:

  • value

    the value to set the attribute style to.



28
29
30
# File 'lib/odf/row.rb', line 28

def style=(value)
  @style = value
end

Instance Method Details

#xmlObject



35
36
37
38
39
40
41
# File 'lib/odf/row.rb', line 35

def xml
  elem_attrs = {}
  elem_attrs['table:style-name'] = @style unless @style.nil?
  Builder::XmlMarkup.new.tag! 'table:table-row', elem_attrs do |xml|
    xml << cells_xml
  end
end