るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
2件ヒット [1-2件を表示] (0.032秒)
トップページ > クエリ:Enumerable#reject[x] > クエリ:lazy[x] > バージョン:2.3.0[x] > クラス:Set[x]

別のキーワード

  1. << rexml::attribute#name
  2. add rexml::attribute#name
  3. handle_interrupt thread#raise
  4. inspect? irb::context#inspect_mode
  5. inspect? irb::context#inspect_mode=

ライブラリ

キーワード

検索結果

Set#reject! {|o| ... } -> self | nil (9397.0)

集合の各要素に対してブロックを実行し、その結果が真であるようなすべての 要素を削除します。

...す。

//emlist[][ruby]{
require 'set'
s1 = Set['hello.rb', 'test.rb', 'hello.rb.bak']
s1.delete_if {|str| str =~ /\.bak\z/}
p s1 # => #<Set: {"hello.rb", "test.rb"}>

s2 = Set['hello.rb', 'test.rb', 'hello.rb.bak']
p s2.reject! {|str| str =~ /\.bak\z/} # => #<Set: {"hello.rb", "test.rb"}>
p s2.rej...

Set#delete_if {|o| ... } -> self (97.0)

集合の各要素に対してブロックを実行し、その結果が真であるようなすべての 要素を削除します。

...す。

//emlist[][ruby]{
require 'set'
s1 = Set['hello.rb', 'test.rb', 'hello.rb.bak']
s1.delete_if {|str| str =~ /\.bak\z/}
p s1 # => #<Set: {"hello.rb", "test.rb"}>

s2 = Set['hello.rb', 'test.rb', 'hello.rb.bak']
p s2.reject! {|str| str =~ /\.bak\z/} # => #<Set: {"hello.rb", "test.rb"}>
p s2.rej...