るりまサーチ

最速Rubyリファレンスマニュアル検索!
26件ヒット [1-26件を表示] (0.036秒)
トップページ > クエリ:Object[x] > クエリ:at[x] > クエリ:methods[x] > クエリ:grep[x]

別のキーワード

  1. _builtin at
  2. _builtin values_at
  3. time at
  4. dbm values_at
  5. gdbm values_at

ライブラリ

モジュール

検索結果

Enumerable#grep(pattern) -> [object] (18334.0)

pattern === item が成立する要素を全て含んだ配列を返します。

...pattern === item が成立する要素を全て含んだ配列を返します。

ブロックとともに呼び出された時には条件の成立した要素に対して
それぞれブロックを評価し、その結果の配列を返します。
マッチする要素がひとつもなかっ...
...返します。

@param pattern 「===」メソッドを持つオブジェクトを指定します。

//emlist[例][ruby]{
['aa', 'bb', 'cc', 'dd', 'ee'].grep(/[bc]/) # => ["bb", "cc"]

Array.instance_methods.grep(/gr/) # => [:grep, :group_by]
//}

@see Enumerable#select
@see Enumerable#grep_v...

Enumerable#grep(pattern) {|item| ... } -> [object] (18334.0)

pattern === item が成立する要素を全て含んだ配列を返します。

...pattern === item が成立する要素を全て含んだ配列を返します。

ブロックとともに呼び出された時には条件の成立した要素に対して
それぞれブロックを評価し、その結果の配列を返します。
マッチする要素がひとつもなかっ...
...返します。

@param pattern 「===」メソッドを持つオブジェクトを指定します。

//emlist[例][ruby]{
['aa', 'bb', 'cc', 'dd', 'ee'].grep(/[bc]/) # => ["bb", "cc"]

Array.instance_methods.grep(/gr/) # => [:grep, :group_by]
//}

@see Enumerable#select
@see Enumerable#grep_v...

NEWS for Ruby 3.0.0 (138.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...s are now separated from positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavi...
...rograms.
* Deprecation warnings are no longer shown by default (since Ruby 2.7.2).
Turn them on with `-W:deprecated` (or with `-w` to show other warnings too).
16345
* `$SAFE` and `$KCODE` are now normal global variables with no special behavior.
C-API methods related to `$SAFE` have...
...#attr_writer and Module#attr methods now return an array of defined method names as symbols. 17314
* Module#alias_method now returns the defined alias as a symbol. 17314

//emlist[][ruby]{
class C; end
module M1; end
module M2; end
C.include M1
M1.include M2
p C.ancestors #=> [C, M1, M2, Object,...