Class: TotallyTabular::Column

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, &block) ⇒ Column

Returns a new instance of Column.



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

def initialize(name, &block)
  @name = name
  @header_attributes = {}
  @row_attributes = {}
  @cell_attributes = {}
  @definition = block
end

Instance Attribute Details

#cell_attributesObject

Returns the value of attribute cell_attributes.



3
4
5
# File 'lib/totally_tabular/column.rb', line 3

def cell_attributes
  @cell_attributes
end

#definitionObject

Returns the value of attribute definition.



3
4
5
# File 'lib/totally_tabular/column.rb', line 3

def definition
  @definition
end

#header_attributesObject

Returns the value of attribute header_attributes.



3
4
5
# File 'lib/totally_tabular/column.rb', line 3

def header_attributes
  @header_attributes
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/totally_tabular/column.rb', line 3

def name
  @name
end

#row_attributesObject

Returns the value of attribute row_attributes.



3
4
5
# File 'lib/totally_tabular/column.rb', line 3

def row_attributes
  @row_attributes
end

#templateObject

Returns the value of attribute template.



3
4
5
# File 'lib/totally_tabular/column.rb', line 3

def template
  @template
end

Instance Method Details

#cell_attributes!(attributes = {}) ⇒ Object



25
26
27
# File 'lib/totally_tabular/column.rb', line 25

def cell_attributes!(attributes={})
  @cell_attributes = attributes
end

#header_attributes!(attributes = {}) ⇒ Object



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

def header_attributes!(attributes={})
  @header_attributes = attributes
end

#row_attributes!(attributes = {}) ⇒ Object



21
22
23
# File 'lib/totally_tabular/column.rb', line 21

def row_attributes!(attributes={})
  @row_attributes = attributes
end

#template!(&block) ⇒ Object



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

def template!(&block)
  @template = block
end