RubySteps 009 - OOP - Easty OOP (excerpt)
class StarWrapper
def initialize(stream)
@stream = stream
end
def puts(string)
print_header_line string
@stream.print "* "
@stream.print string
@stream.puts " *"
print_header_line string
end
def print_header_line(string)
(string.size + 4).times { @stream.print "*" }
@stream.puts
end
end