From: Gianfranco Bozzetti Date: 2012-09-27T18:52:36+09:00 Subject: Re: Subclassing Date Damián M. González wrote in post #1077685: > Oh ok! now I'll have to seek another way, thanks for deal. You can use composition instead of subclassing, as in require 'date' class Dia def initialize(ano, mes, dia, obj_mes) @mes=obj_mes @d = Date.new(ano,mes,dia) end def print() printf "date = %04d-%02d-%02d : obj_mes = %-s\n ", @d.year, @d.month, @d.day, @mes end end a = Dia.new(2012, 6, 21,"foo") a.print() __END__ Output: [2012/09/27] [11:17:47.31] [C:\_MyPrg\Ruby\Exper\Forum] ruby subdate.rb date = 2012-06-21 : obj_mes = foo HTH gfb -- Posted via http://www.ruby-forum.com/.