Class: RubyRTF::Table::Row::Cell
- Inherits:
-
Object
- Object
- RubyRTF::Table::Row::Cell
- Defined in:
- lib/ruby-rtf/table.rb
Instance Attribute Summary collapse
-
#idx ⇒ Object
Returns the value of attribute idx.
-
#row ⇒ Object
Returns the value of attribute row.
-
#sections ⇒ Object
Returns the value of attribute sections.
Instance Method Summary collapse
- #<<(obj) ⇒ Object
-
#initialize(row, idx) ⇒ Cell
constructor
A new instance of Cell.
- #table ⇒ Object
- #width ⇒ Object
Constructor Details
#initialize(row, idx) ⇒ Cell
Returns a new instance of Cell.
46 47 48 49 50 |
# File 'lib/ruby-rtf/table.rb', line 46 def initialize(row, idx) @row = row @idx = idx @sections = [] end |
Instance Attribute Details
#idx ⇒ Object
Returns the value of attribute idx.
44 45 46 |
# File 'lib/ruby-rtf/table.rb', line 44 def idx @idx end |
#row ⇒ Object
Returns the value of attribute row.
44 45 46 |
# File 'lib/ruby-rtf/table.rb', line 44 def row @row end |
#sections ⇒ Object
Returns the value of attribute sections.
44 45 46 |
# File 'lib/ruby-rtf/table.rb', line 44 def sections @sections end |
Instance Method Details
#<<(obj) ⇒ Object
52 53 54 |
# File 'lib/ruby-rtf/table.rb', line 52 def <<(obj) @sections << obj end |
#table ⇒ Object
56 57 58 |
# File 'lib/ruby-rtf/table.rb', line 56 def table row.table end |
#width ⇒ Object
60 61 62 63 64 65 66 67 68 |
# File 'lib/ruby-rtf/table.rb', line 60 def width gap = row.table.half_gap left_margin = row.table.left_margin end_pos = row.end_positions[idx] prev_pos = idx == 0 ? 0 : row.end_positions[idx - 1] ((end_pos - prev_pos - (2 * gap) - left_margin) / row.end_positions[-1]) * 100 end |