21件ヒット
[1-21件を表示]
(0.101秒)
検索結果
-
Class
# superclass -> Class | nil (26241.0) -
自身のスーパークラスを返します。
...y]{
File.superclass #=> IO
IO.superclass #=> Object
class Foo; end
class Bar < Foo; end
Bar.superclass #=> Foo
Object.superclass #=> BasicObject
//}
ただし BasicObject.superclass は nil を返します。
//emlist[例][ruby]{
BasicObject.superclass #=> ni... -
Method
# super _ method -> Method | nil (8116.0) -
self 内で super を実行した際に実行されるメソッドを Method オブジェ クトにして返します。
...][ruby]{
class Super
def foo
"superclass method"
end
end
class Sub < Super
def foo
"subclass method"
end
end
m = Sub.new.method(:foo) # => #<Method: Sub#foo>
m.call # => "subclass method"
m.super_method # => #<Method: Super#foo>
m.super_method.call # => "superclass method"
//}...