[問題] super的呼叫
class A
def a
puts "A exe"
end
def b
puts "B exe"
end
end
class B < A
def a
#HOW TO CALL A.b ??
super
puts "A2 exe"
end
def b
super
puts "B2 exe"
end
end
a=B.new
a.a
新手,正在邊看書邊練習
想請問這種狀況要怎麼解決?有辦法呼叫的到嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.38.65.154
→
12/19 00:11, , 1F
12/19 00:11, 1F
→
12/19 00:11, , 2F
12/19 00:11, 2F
→
12/19 00:12, , 3F
12/19 00:12, 3F
→
12/19 00:12, , 4F
12/19 00:12, 4F
→
12/19 00:15, , 5F
12/19 00:15, 5F
→
12/19 00:29, , 6F
12/19 00:29, 6F
→
12/19 00:29, , 7F
12/19 00:29, 7F
→
12/19 00:30, , 8F
12/19 00:30, 8F
→
12/19 14:02, , 9F
12/19 14:02, 9F
Ruby 近期熱門文章
PTT數位生活區 即時熱門文章