Class: Wee::Brush::TableRowTag

Inherits:
GenericTagBrush show all
Defined in:
lib/wee/html_brushes.rb

Constant Summary collapse

HTML_TAG =
'tr'.freeze

Instance Attribute Summary

Attributes inherited from Wee::Brush

#canvas, #document

Instance Method Summary collapse

Methods inherited from GenericTagBrush

#get_oid, html_attr, #oid, #onclick_callback, #onclick_javascript, #onclick_update_callback, #onclick_update_self_callback, #ondblclick_callback, #with

Methods inherited from Wee::Brush

#close, nesting?, #setup, #with

Constructor Details

#initializeTableRowTag

Returns a new instance of TableRowTag.



210
211
212
# File 'lib/wee/html_brushes.rb', line 210

def initialize
  super(HTML_TAG)
end

Instance Method Details

#columns(*cols, &block) ⇒ Object



214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'lib/wee/html_brushes.rb', line 214

def columns(*cols, &block)
  with {
    cols.each {|col|
      @canvas.table_data.with {
        if block
          block.call(col)
        else
          @canvas.text(col)
        end
      }
    }
  } 
end

#headings(*headers, &block) ⇒ Object



228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/wee/html_brushes.rb', line 228

def headings(*headers, &block)
  with {
    headers.each {|header|
      @canvas.table_header.with {
        if block
          block.call(header)
        else
          @canvas.text(header)
        end
      }
    }
  } 
end

#spacerObject



246
247
248
# File 'lib/wee/html_brushes.rb', line 246

def spacer
  with { @canvas.table_data { @canvas.space } }
end

#spanning_column(str, colspan) ⇒ Object



242
243
244
# File 'lib/wee/html_brushes.rb', line 242

def spanning_column(str, colspan)
  with { @canvas.table_data.col_span(colspan).with(str) }
end