Module: Printer

Included in:
HashTable, Sam
Defined in:
lib/germ/printer.rb

Instance Method Summary collapse

Instance Method Details



8
9
10
11
12
13
14
# File 'lib/germ/printer.rb', line 8

def print f=nil, &block
  if f
    write f, &block
  else
    output STDOUT, &block
  end
end

#write(file, &block) ⇒ Object



2
3
4
5
6
# File 'lib/germ/printer.rb', line 2

def write file, &block
  File.open(file,"w") do |f|
    output f, &block
  end
end