Class: LatexTools::LatexTable::Row

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/latex_table.rb

Overview

:nodoc: all

Constant Summary collapse

TAGS =
[
    :cline,
    :hline,
    :provisional
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tag = nil) ⇒ Row

Returns a new instance of Row.



71
72
73
74
75
76
77
# File 'lib/latex_table.rb', line 71

def initialize(tag = nil)
  @entries = Array.new
  if(tag)
    raise ArgumentError unless TAGS.include?(tag)
    @special_tag = tag
  end
end

Instance Attribute Details

#special_tagObject Also known as: tag

Returns the value of attribute special_tag.



59
60
61
# File 'lib/latex_table.rb', line 59

def special_tag
  @special_tag
end

Instance Method Details

#num_columnsObject



79
80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/latex_table.rb', line 79

def num_columns
  if(@special_tag == :cline)
    return @entries.last.end_col
  end
  ret_val = 0
  @entries.each do |entry|
    add_val = entry.kind_of?(MultiColumn) ? entry.width : 1
    if add_val == :fill
      return -1
    end
    ret_val += add_val
  end
  return ret_val
end