From: Brian Schroeder Date: 2004-09-24T08:24:32+09:00 Subject: Re: mixin with A::B syntax On Thu, 23 Sep 2004 19:52:01 +0000, eagle eyes joe wrote: > Greetings, > > I want to define a generic print method to use in debugging. I got the > mix in syntax okay for classes like Hash or String, but for Mysql::Result, > it doesn't seem to work. What would the proper syntax be? > > > Joe Alotta > > > #!/usr/bin/ruby > > require 'mysql' > > class Mysql::Result > def print > self.each_hash do |i| > i.each do |k, v| { print "#{k} = #{v} "} puts > > end > end > end > > m = Mysql.new("localhost", "root", "", "Development") > > s = m.query("select * from symbols where type = 'MU'") > > s.print > > > Joe Alotta module Mysql class Result def print [...] end end end regards, Brian -- Brian Schræ—¦der http://www.brian-schroeder.de/