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

  • How Things Are Made

    How Things A

    17 HAZİRAN 2008
  • LaKe Lightroom Tutorials

    LaKe Lightro

    22 Temmuz 2014
  • PCDIY

    PCDIY

    16 AĞUSTOS 2013