るりまサーチ (Ruby 2.7.0)

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

クラス

検索結果

MatchData#names -> [String] (78361.0)

名前付きキャプチャの名前を文字列配列で返します。

名前付きキャプチャの名前を文字列配列で返します。

self.regexp.names と同じです。

//emlist[例][ruby]{
/(?<foo>.)(?<bar>.)(?<baz>.)/.match("hoge").names
# => ["foo", "bar", "baz"]

m = /(?<x>.)(?<y>.)?/.match("a") # => #<MatchData "a" x:"a" y:nil>
m.names # => ["x", "y"]
//}

Regexp#names -> [String] (78361.0)

正規表現に含まれる名前付きキャプチャ(named capture)の名前を 文字列の配列で返します。

正規表現に含まれる名前付きキャプチャ(named capture)の名前を
文字列の配列で返します。

//emlist[例][ruby]{
/(?<foo>.)(?<bar>.)(?<baz>.)/.names

# => ["foo", "bar", "baz"]
/(?<foo>.)(?<foo>.)/.names
# => ["foo"]

/(.)(.)/.names
# => []
//}

Encoding#names -> String (78325.0)

エンコーディングの名前とエイリアス名の配列を返します。

エンコーディングの名前とエイリアス名の配列を返します。

//emlist[例][ruby]{
Encoding::UTF_8.names #=> ["UTF-8", "CP65001"]
//}

Module#ruby2_keywords(method_name, ...) -> nil (24052.0)

For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.

For the given method names, marks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword argument...