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

  • BumbleDroid

    BumbleDroid

    18 EKİM 2010
  • GoProTutorials

    GoProTutoria

    18 NİSAN 2011
  • The Computer Chronicles

    The Computer

    7 Kasım 2012