Class: BOAST::CodeBlock
Instance Method Summary collapse
-
#initialize(&block) ⇒ CodeBlock
constructor
A new instance of CodeBlock.
- #print(final = true) ⇒ Object
Constructor Details
#initialize(&block) ⇒ CodeBlock
Returns a new instance of CodeBlock.
755 756 757 |
# File 'lib/BOAST/Algorithm.rb', line 755 def initialize(&block) @block = block end |
Instance Method Details
#print(final = true) ⇒ Object
759 760 761 762 763 764 765 766 767 768 769 |
# File 'lib/BOAST/Algorithm.rb', line 759 def print(final=true) s="" s += " "*BOAST::get_indent_level if final BOAST::increment_indent_level BOAST::get_output.puts s if final if @block then s += "\n" @block.call end return s end |