Class: TextDoc
Defined Under Namespace
Classes: WriterWrapper
Instance Method Summary collapse
- #li(options = {}, &block) ⇒ Object
- #td(options = {}, &block) ⇒ Object
-
#th(options = {}, &block) ⇒ Object
writer(options, &block) << ānā.
- #tr(options = {}, &block) ⇒ Object
- #ul(options = {}, &block) ⇒ Object
Methods inherited from BaseDoc
#bare_table, #call_total_function, #close, #end_doc, #flatten_columns, #generate_table, #initialize, #options_for_functions, #options_for_functions_orig, #p, #print, #start_doc, #table, #table_item, #table_items, #title, #tn
Constructor Details
This class inherits a constructor from BaseDoc
Instance Method Details
#li(options = {}, &block) ⇒ Object
43 44 45 |
# File 'lib/libisi/doc/text.rb', line 43 def li( = {}, &block) writer(, &block) << " * #{block(yield,3).strip}\n" end |
#td(options = {}, &block) ⇒ Object
33 34 35 36 37 |
# File 'lib/libisi/doc/text.rb', line 33 def td( = {}, &block); # writer(options, &block) << " #{yield.inspect} |" @rows[-1].push(yield.to_s.gsub("\n","")) [:colspan].times {@rows[-1].push(-1)} if [:colspan] end |
#th(options = {}, &block) ⇒ Object
writer(options, &block) << ānā
28 29 30 31 32 |
# File 'lib/libisi/doc/text.rb', line 28 def th( = {}, &block); #writer(options, &block) << " #{yield.inspect.upcase} |" @rows[-1].push(yield.to_s.upcase.gsub("\n","")) # options[:colspan].times {@rows[-1].push(nil} if options[:colspan] end |
#tr(options = {}, &block) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/libisi/doc/text.rb', line 22 def tr( = {}, &block); @rows.push([]) #writer(options, &block) << "|" yield #writer(options, &block) << "\n" end |
#ul(options = {}, &block) ⇒ Object
39 40 41 42 |
# File 'lib/libisi/doc/text.rb', line 39 def ul( = {}, &block) # writer(options, &block) << "#{yield}" yield end |