Class: Tableasy::Table::Cell

Inherits:
Object
  • Object
show all
Includes:
HtmlAttributes
Defined in:
lib/tableasy/table/cell.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HtmlAttributes

#html

Constructor Details

#initialize(subject, value, header = false) ⇒ Cell

Returns a new instance of Cell.



8
9
10
11
12
# File 'lib/tableasy/table/cell.rb', line 8

def initialize(subject, value, header = false)
  @subject = subject
  @header = header
  self.value = value
end

Instance Attribute Details

#headerObject

Returns the value of attribute header.



5
6
7
# File 'lib/tableasy/table/cell.rb', line 5

def header
  @header
end

#subjectObject (readonly)

Returns the value of attribute subject.



6
7
8
# File 'lib/tableasy/table/cell.rb', line 6

def subject
  @subject
end

#valueObject

Returns the value of attribute value.



5
6
7
# File 'lib/tableasy/table/cell.rb', line 5

def value
  @value
end

Instance Method Details

#tagObject



24
25
26
# File 'lib/tableasy/table/cell.rb', line 24

def tag
  @header ? 'th' : 'td'
end