class Mdextab::Table

Tableクラス

Attributes

lineno[R]

@return 入力Markdownファイル中のTABLEトークン出現行

tbody[R]

@return TABLE中のTBODYトークン出現行

Public Class Methods

new(lineno, mes, attr=nil) click to toggle source

初期化

@param lineno [Integer] TABLE_STARTトークンの出現行の行番号 @param mes [Messagex] Messagexクラスのインスタンス @param sttr [String] TABLE_STARTトークンの属性

# File lib/mdextab/table.rb, line 36
def initialize(lineno, mes, attr=nil)
  @lineno = lineno
  @attr = attr
  @tbody = nil
  @mes = mes
end

Public Instance Methods

add_tbody(lineno) click to toggle source

tbodyの追加

@param lineno [Integer] TBODY_STARTトークンまたは暗黙のtbodyの出現に係るトークンの出現行の行番号 @return [void]

# File lib/mdextab/table.rb, line 48
def add_tbody(lineno)
  @tbody = Tbody.new(lineno, @mes)
end
table_end() click to toggle source

tableの終了処理

@return (see to_s)

# File lib/mdextab/table.rb, line 64
def table_end
  to_s
end
tbody_end() click to toggle source

tbodyの終了処理

@return [void]

# File lib/mdextab/table.rb, line 56
def tbody_end
  @tbody.finish
end
to_s(debug=false) click to toggle source

tableの文字列化

@param debug [Symbol] デバッグ用フラグ true: デバッグ情報を付加する false: デバッグ情報を付加しない @return [String] HTMLのTABLEタグとして文字列化したもの

# File lib/mdextab/table.rb, line 73
def to_s(debug=false)
  if @attr
    if debug
      str = %Q(<table #{@attr} lineno:#{@lineno}>)
    else
      str = %Q(<table #{@attr}>)
    end
  elsif debug
    str = %Q(<table  lineno:#{@lineno}>)
  else
    str = %Q(<table>)
  end

  [str, @tbody.to_s, "</table>"].join("\n")
end