Class: PostRunner::FlexiTable::Row
- Inherits:
-
Array
- Object
- Array
- PostRunner::FlexiTable::Row
- Defined in:
- lib/postrunner/FlexiTable.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
- #cell(content, attributes) ⇒ Object
-
#initialize(table) ⇒ Row
constructor
A new instance of Row.
- #set_indicies(col_idx, row_idx) ⇒ Object
- #set_row_attributes(attributes) ⇒ Object
- #to_html(doc) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(table) ⇒ Row
Returns a new instance of Row.
91 92 93 94 95 |
# File 'lib/postrunner/FlexiTable.rb', line 91 def initialize(table) @table = table @attributes = Attributes.new super() end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
89 90 91 |
# File 'lib/postrunner/FlexiTable.rb', line 89 def attributes @attributes end |
Instance Method Details
#cell(content, attributes) ⇒ Object
97 98 99 100 101 |
# File 'lib/postrunner/FlexiTable.rb', line 97 def cell(content, attributes) c = Cell.new(@table, self, content, attributes) self << c c end |
#set_indicies(col_idx, row_idx) ⇒ Object
103 104 105 |
# File 'lib/postrunner/FlexiTable.rb', line 103 def set_indicies(col_idx, row_idx) self[col_idx].set_indicies(col_idx, row_idx) end |
#set_row_attributes(attributes) ⇒ Object
107 108 109 |
# File 'lib/postrunner/FlexiTable.rb', line 107 def set_row_attributes(attributes) @attributes = Attributes.new(attributes) end |
#to_html(doc) ⇒ Object
122 123 124 125 126 |
# File 'lib/postrunner/FlexiTable.rb', line 122 def to_html(doc) doc.tr { each { |c| c.to_html(doc) } } end |
#to_s ⇒ Object
111 112 113 114 115 116 117 118 119 120 |
# File 'lib/postrunner/FlexiTable.rb', line 111 def to_s s = '' frame = @table.frame s << '|' if frame s << join(frame ? '|' : ' ') s << '|' if frame s end |