Class: SimpleTable::Rows

Inherits:
Tag
  • Object
show all
Defined in:
lib/simple_table/rows.rb

Direct Known Subclasses

Body, Foot, Head

Instance Attribute Summary collapse

Attributes inherited from Tag

#options, #parent

Instance Method Summary collapse

Methods inherited from Tag

#add_class, #collection_class, #collection_name, #head?, #render, #table

Constructor Details

#initialize(parent, options = {}) ⇒ Rows

Returns a new instance of Rows.



7
8
9
10
# File 'lib/simple_table/rows.rb', line 7

def initialize(parent, options = {})
  @rows = []
  super
end

Instance Attribute Details

#rowsObject (readonly)

Returns the value of attribute rows.



5
6
7
# File 'lib/simple_table/rows.rb', line 5

def rows
  @rows
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/simple_table/rows.rb', line 12

def empty?
  rows.empty?
end

#row(*args, &block) ⇒ Object



16
17
18
19
# File 'lib/simple_table/rows.rb', line 16

def row(*args, &block)
  options = args.extract_options!
  rows << Row.new(self, args.shift, options, &block)
end