SORU
9 AĞUSTOS 2009, Pazar


ruby süper sınıf başka bir yöntem arıyorum

class A
  def a
    puts 'in #a'
  end
end

class B < A
  def a
    b()
  end
  def b
    # here i want to call A#a.
  end
end  

CEVAP
9 AĞUSTOS 2009, Pazar


class B < A

  alias :super_a :a

  def a
    b()
  end
  def b
    super_a()
  end
end

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • hydejiaqi

    hydejiaqi

    12 Mart 2008
  • Migs351

    Migs351

    3 HAZİRAN 2007
  • Shantanu Sood

    Shantanu Soo

    3 Kasım 2008