class PrintyBoy def initialize(stream) @stream = stream end def print_em @stream.each {|y| puts y} end end class CharStream include Enumerable def initialize(str) puts "str.chars: #{str.chars.class} of #{str.chars.length} chars" @str = str.chars end def each(&block) @str.each &block end def empty? @str.empty? end def length @str.length end end cs = CharStream.new "cockshitbitchcuntaahhhh" pb = PrintyBoy.new cs pb.print_em