3件ヒット
[1-3件を表示]
(0.028秒)
種類
- 変数 (2)
- インスタンスメソッド (1)
キーワード
-
$ ERROR _ INFO (1) -
$ ERROR _ POSITION (1) - DelegateClass (1)
検索結果
先頭3件
-
Kernel
# DelegateClass(superclass) -> object (18658.0) -
クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、 そのクラスを返します。
クラス superclass のインスタンスへメソッドを委譲するクラスを定義し、
そのクラスを返します。
@param superclass 委譲先となるクラス
例:
//emlist{
require 'delegate'
class ExtArray < DelegateClass(Array)
def initialize
super([])
end
end
a = ExtArray.new
p a.class # => ExtArray
a.push 25
p a # => [25]
//} -
Kernel
$ $ ERROR _ INFO -> Exception | nil (40.0) -
$! の別名
$! の別名
require "English"
class SomethingError < StandardError; end
begin
raise SomethingError
rescue
p $ERROR_INFO.backtrace #=> ["sample.rb:5"]
p $ERROR_INFO.to_s #=> "SomethingError"
end -
Kernel
$ $ ERROR _ POSITION -> [String] | nil (40.0) -
$@ の別名
$@ の別名
require "English"
class SomethingError < StandardError; end
begin
raise SomethingError
rescue
p $ERROR_POSITION #=> ["sample.rb:5"]
end