Class: Tableasy::Table::Cell
- Inherits:
-
Object
- Object
- Tableasy::Table::Cell
- Includes:
- HtmlAttributes
- Defined in:
- lib/tableasy/table/cell.rb
Instance Attribute Summary collapse
-
#header ⇒ Object
Returns the value of attribute header.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(subject, value, header = false) ⇒ Cell
constructor
A new instance of Cell.
- #tag ⇒ Object
Methods included from HtmlAttributes
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
#header ⇒ Object
Returns the value of attribute header.
5 6 7 |
# File 'lib/tableasy/table/cell.rb', line 5 def header @header end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
6 7 8 |
# File 'lib/tableasy/table/cell.rb', line 6 def subject @subject end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/tableasy/table/cell.rb', line 5 def value @value end |
Instance Method Details
#tag ⇒ Object
24 25 26 |
# File 'lib/tableasy/table/cell.rb', line 24 def tag @header ? 'th' : 'td' end |