Method: FormatR::Format#printFormat

Defined in:
lib/formatr.rb

#printFormat(aBinding, io = @io) ⇒ Object

Print out the specified format. You need to pass in a Binding object for the variables that will be used in the format. This is usually just a call to Kernel.binding. The next argument gives a file handler to print to. This is useful so that a top or bottom’s output get written to the same place as the main format is going even if their formats have a different io when they’re not attached.



665
666
667
668
669
670
671
672
673
674
675
676
# File 'lib/formatr.rb', line 665

def printFormat (aBinding, io = @io)
  if (@use_hash)
    if (aBinding.is_a?( Binding ))
      printFormatFromBinding( aBinding, io )                  
    else
      printFormatWithHash( aBinding, io )
    end
  else
    printFormatWithBinding( aBinding, io )

  end
end