Skip to content

Instantly share code, notes, and snippets.

@patmaddox
Created August 8, 2014 01:54
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patmaddox/ba7ba511a412f28ace76 to your computer and use it in GitHub Desktop.
Save patmaddox/ba7ba511a412f28ace76 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment