Class: Mdextab::Table
- Inherits:
-
Object
- Object
- Mdextab::Table
- Extended by:
- Forwardable
- Defined in:
- lib/mdextab/table.rb
Instance Attribute Summary collapse
-
#lineno ⇒ Object
readonly
Returns the value of attribute lineno.
-
#tbody ⇒ Object
readonly
Returns the value of attribute tbody.
Instance Method Summary collapse
- #add_tbody(lineno) ⇒ Object
- #end ⇒ Object
-
#initialize(lineno, mes, attr = nil) ⇒ Table
constructor
A new instance of Table.
- #table_end ⇒ Object
- #tbody_end ⇒ Object
- #to_s(debug = false) ⇒ Object
Constructor Details
#initialize(lineno, mes, attr = nil) ⇒ Table
Returns a new instance of Table.
9 10 11 12 13 14 |
# File 'lib/mdextab/table.rb', line 9 def initialize(lineno, mes, attr=nil) @lineno = lineno @attr = attr @tbody = nil @mes = mes end |
Instance Attribute Details
#lineno ⇒ Object (readonly)
Returns the value of attribute lineno.
7 8 9 |
# File 'lib/mdextab/table.rb', line 7 def lineno @lineno end |
#tbody ⇒ Object (readonly)
Returns the value of attribute tbody.
7 8 9 |
# File 'lib/mdextab/table.rb', line 7 def tbody @tbody end |
Instance Method Details
#add_tbody(lineno) ⇒ Object
16 17 18 |
# File 'lib/mdextab/table.rb', line 16 def add_tbody(lineno) @tbody = Tbody.new(lineno, @mes) end |
#end ⇒ Object
24 25 26 |
# File 'lib/mdextab/table.rb', line 24 def end table_end end |
#table_end ⇒ Object
28 29 30 |
# File 'lib/mdextab/table.rb', line 28 def table_end to_s end |
#tbody_end ⇒ Object
20 21 22 |
# File 'lib/mdextab/table.rb', line 20 def tbody_end @tbody.end end |
#to_s(debug = false) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/mdextab/table.rb', line 32 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 |