Class: RODF::Table
Instance Method Summary collapse
- #create_row ⇒ Object
-
#initialize(title) ⇒ Table
constructor
A new instance of Table.
- #row(options = {}, &contents) ⇒ Object
- #xml ⇒ Object
Methods inherited from Container
Constructor Details
#initialize(title) ⇒ Table
Returns a new instance of Table.
28 29 30 31 |
# File 'lib/rodf/table.rb', line 28 def initialize(title) @title = title @last_row = 0 end |
Instance Method Details
#create_row ⇒ Object
33 |
# File 'lib/rodf/table.rb', line 33 alias create_row row |
#row(options = {}, &contents) ⇒ Object
34 35 36 |
# File 'lib/rodf/table.rb', line 34 def row(={}, &contents) create_row(next_row, ) {instance_eval(&contents) if block_given?} end |
#xml ⇒ Object
38 39 40 41 42 43 |
# File 'lib/rodf/table.rb', line 38 def xml Builder::XmlMarkup.new.table:table, 'table:name' => @title do |xml| xml << columns_xml xml << rows_xml end end |