Class: RODF::Column

Inherits:
Object
  • Object
show all
Defined in:
lib/rodf/column.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Column

Returns a new instance of Column.



3
4
5
6
7
8
9
10
11
# File 'lib/rodf/column.rb', line 3

def initialize(opts={})
  @elem_attrs = {}

  @elem_attrs['table:style-name'] = opts[:style] unless opts[:style].nil?

  if opts[:attributes]
    @elem_attrs.merge!(opts[:attributes])
  end
end

Instance Method Details

#style=(style_name) ⇒ Object



13
14
15
# File 'lib/rodf/column.rb', line 13

def style=(style_name)
  @elem_attrs['table:style-name'] = style_name
end

#xmlObject



17
18
19
# File 'lib/rodf/column.rb', line 17

def xml
  Builder::XmlMarkup.new.tag! 'table:table-column', @elem_attrs
end