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.
855 856 857 |
# File 'lib/BOAST/Algorithm.rb', line 855 def initialize(&block) @block = block end |
Instance Method Details
#print(final = true) ⇒ Object
859 860 861 862 863 864 865 866 867 868 869 |
# File 'lib/BOAST/Algorithm.rb', line 859 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 |