Class: Wee::Brush::TableRowTag

Inherits:
GenericTagBrush show all
Defined in:
lib/wee/renderer/html/brushes.rb

Instance Attribute Summary

Attributes inherited from Wee::Brush

#canvas, #parent

Instance Method Summary collapse

Methods inherited from GenericTagBrush

#__action_callback, #__actionurl_callback, #__actionurl_named_callback, #__input_callback, #css_class, #css_class_for, #method_missing, #onclick_callback, #onclick_update, #with

Methods inherited from Wee::Brush

#close, #with

Constructor Details

#initializeTableRowTag

Returns a new instance of TableRowTag.



232
233
234
# File 'lib/wee/renderer/html/brushes.rb', line 232

def initialize
  super('tr')
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Wee::Brush::GenericTagBrush

Instance Method Details

#align_topObject



236
237
238
# File 'lib/wee/renderer/html/brushes.rb', line 236

def align_top
  html_attr('align', 'top')
end

#columns(*cols, &block) ⇒ Object



240
241
242
243
244
245
246
247
248
249
250
251
252
# File 'lib/wee/renderer/html/brushes.rb', line 240

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



254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/wee/renderer/html/brushes.rb', line 254

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

#spacerObject



274
275
276
277
278
# File 'lib/wee/renderer/html/brushes.rb', line 274

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

#spanning_column(str, colspan) ⇒ Object



268
269
270
271
272
# File 'lib/wee/renderer/html/brushes.rb', line 268

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