[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dennou-ruby:001287] initialize mathod



��߷�Ǥ���

C�ǽ񤫤줿Class�� subClass�� initialize�᥽�åɤ�
new���˸ƤӽФ���ʤ��ߤ����ʤ�Ǥ�����
����äƻ��ͤʤ�Ǥ��礦����


e.g
%irb
irb(main):001:0> require "narray"
true
irb(main):002:0> class Test  < NArray
irb(main):003:1> def initialize
irb(main):004:2> p "a"
irb(main):005:2> end
irb(main):006:1> end
nil
irb(main):007:0> Test.new(1,1)
Test.byte(1): 
[ 0 ]


��»�ͽ����Τ����
class NArrayMiss
  def initialize(*arg)
     super
     @xxxxxx = NArray.byte(*arg[1..-1]).fill(0)
  end
  :
end
�ߤ����ʥ��饹�������Ȥ�����Ǥ���@xxxxxx
���⤽�⤳��ʤ�����ְ�äƤޤ�?
�Ǥ����ruby�ǽ񤭤����ΤǤ�����
----------
Seiya Nishizawa
seiya@xxxxxx