るりまサーチ

最速Rubyリファレンスマニュアル検索!
242件ヒット [1-100件を表示] (0.096秒)

別のキーワード

  1. kernel $-l
  2. matrix l
  3. _builtin $-l
  4. lupdecomposition l
  5. l

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 > >>

Kernel$$3 -> String | nil (18201.0)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...値が格納されます。
該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

番号 n はいくらでも大きな正整数を利用できます。

Regexp.last_match(1),
Regexp.last_match(2), ... と同じ。

これらの変数はローカルス...
...コープかつスレッドローカル、読み取り専用です。

//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)">(.*?)</a>] =~ str
print $1
print $2
end
#=> "http://example.com"
#=> "example.com"
//}...

Kernel.#caller(range) -> [String] | nil (6106.0)

start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。

...ます。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。

引数で指定した値が範囲外の場合は nil を返します。

@param start long の範囲を超えない正の整数でスタックレベルを指定します。
@param length 取得...
...囲を示す Range オブジェクトを指定します。

@see Kernel.#set_trace_func,Kernel.#raise,
Kernel.#caller_locations

//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end

def bar
foo
end

bar

#=> ["-:2:in `foo'", "-:10:in `bar'",...
...[]
# nil
//}

以下の関数は、caller の要素から [ファイル名, 行番号, メソッド名]
を取り出して返します。

//emlist[例][ruby]{
def parse_caller(at)
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
file = $1
l
ine = $2.to_i
method = $3
[file, line, method]...

Kernel.#caller(start = 1) -> [String] | nil (6106.0)

start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。

...ます。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。

引数で指定した値が範囲外の場合は nil を返します。

@param start long の範囲を超えない正の整数でスタックレベルを指定します。
@param length 取得...
...囲を示す Range オブジェクトを指定します。

@see Kernel.#set_trace_func,Kernel.#raise,
Kernel.#caller_locations

//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end

def bar
foo
end

bar

#=> ["-:2:in `foo'", "-:10:in `bar'",...
...[]
# nil
//}

以下の関数は、caller の要素から [ファイル名, 行番号, メソッド名]
を取り出して返します。

//emlist[例][ruby]{
def parse_caller(at)
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
file = $1
l
ine = $2.to_i
method = $3
[file, line, method]...

Kernel.#caller(start, length) -> [String] | nil (6106.0)

start 段上の呼び出し元の情報を $@ の形式のバックトレース(文字列の配列)として返します。

...ます。caller の戻り値を $@ に代入することで
例外の発生位置を設定できます。

引数で指定した値が範囲外の場合は nil を返します。

@param start long の範囲を超えない正の整数でスタックレベルを指定します。
@param length 取得...
...囲を示す Range オブジェクトを指定します。

@see Kernel.#set_trace_func,Kernel.#raise,
Kernel.#caller_locations

//emlist[例][ruby]{
def foo
p caller(0)
p caller(1)
p caller(2)
p caller(3)
p caller(4)
end

def bar
foo
end

bar

#=> ["-:2:in `foo'", "-:10:in `bar'",...
...[]
# nil
//}

以下の関数は、caller の要素から [ファイル名, 行番号, メソッド名]
を取り出して返します。

//emlist[例][ruby]{
def parse_caller(at)
if /^(.+?):(\d+)(?::in `(.*)')?/ =~ at
file = $1
l
ine = $2.to_i
method = $3
[file, line, method]...

Kernel$$1 -> String | nil (3101.0)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...値が格納されます。
該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

番号 n はいくらでも大きな正整数を利用できます。

Regexp.last_match(1),
Regexp.last_match(2), ... と同じ。

これらの変数はローカルス...
...コープかつスレッドローカル、読み取り専用です。

//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)">(.*?)</a>] =~ str
print $1
print $2
end
#=> "http://example.com"
#=> "example.com"
//}...

絞り込み条件を変える

Kernel$$10 -> String | nil (3101.0)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...値が格納されます。
該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

番号 n はいくらでも大きな正整数を利用できます。

Regexp.last_match(1),
Regexp.last_match(2), ... と同じ。

これらの変数はローカルス...
...コープかつスレッドローカル、読み取り専用です。

//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)">(.*?)</a>] =~ str
print $1
print $2
end
#=> "http://example.com"
#=> "example.com"
//}...

Kernel$$11 -> String | nil (3101.0)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...値が格納されます。
該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

番号 n はいくらでも大きな正整数を利用できます。

Regexp.last_match(1),
Regexp.last_match(2), ... と同じ。

これらの変数はローカルス...
...コープかつスレッドローカル、読み取り専用です。

//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)">(.*?)</a>] =~ str
print $1
print $2
end
#=> "http://example.com"
#=> "example.com"
//}...

Kernel$$2 -> String | nil (3101.0)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...値が格納されます。
該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

番号 n はいくらでも大きな正整数を利用できます。

Regexp.last_match(1),
Regexp.last_match(2), ... と同じ。

これらの変数はローカルス...
...コープかつスレッドローカル、読み取り専用です。

//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)">(.*?)</a>] =~ str
print $1
print $2
end
#=> "http://example.com"
#=> "example.com"
//}...

Kernel$$4 -> String | nil (3101.0)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...値が格納されます。
該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

番号 n はいくらでも大きな正整数を利用できます。

Regexp.last_match(1),
Regexp.last_match(2), ... と同じ。

これらの変数はローカルス...
...コープかつスレッドローカル、読み取り専用です。

//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)">(.*?)</a>] =~ str
print $1
print $2
end
#=> "http://example.com"
#=> "example.com"
//}...

Kernel$$5 -> String | nil (3101.0)

最後に成功したパターンマッチで n 番目の括弧にマッチした値が格納されます。 該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

...値が格納されます。
該当する括弧がなければ nil が入っています。(覚え方: \数字 のようなもの)

番号 n はいくらでも大きな正整数を利用できます。

Regexp.last_match(1),
Regexp.last_match(2), ... と同じ。

これらの変数はローカルス...
...コープかつスレッドローカル、読み取り専用です。

//emlist[例][ruby]{
str = '<p><a href="http://example.com">example.com</a></p>'
if %r[<a href="(.*?)">(.*?)</a>] =~ str
print $1
print $2
end
#=> "http://example.com"
#=> "example.com"
//}...

絞り込み条件を変える

<< 1 2 3 > >>