るりまサーチ

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

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

ライブラリ

クラス

モジュール

キーワード

検索結果

Enumerable#detect(ifnone = nil) -> Enumerator (18302.0)

要素に対してブロックを評価した値が真になった最初の要素を返します。

...らず、ifnone も指定されていないときは nil を返します。
真になる要素が見つからず、ifnone が指定されているときは ifnone を call した結果を返します。

ブロックを省略した場合は Enumerator を返します。

@param ifnone call メソ...
...初の 3 の倍数を探す
p [1, 2, 3, 4, 5].find {|i| i % 3 == 0 } # => 3
p [2, 2, 2, 2, 2].find {|i| i % 3 == 0 } # => nil

# ifnone の使用例
ifnone = proc { raise ArgumentError, "item not found" }
p [1, 2, 3, 4, 5].find(ifnone) {|i| i % 7 == 0 }
# ArgumentError: item not found
//}...

Enumerable#detect(ifnone = nil) {|item| ... } -> object (18302.0)

要素に対してブロックを評価した値が真になった最初の要素を返します。

...らず、ifnone も指定されていないときは nil を返します。
真になる要素が見つからず、ifnone が指定されているときは ifnone を call した結果を返します。

ブロックを省略した場合は Enumerator を返します。

@param ifnone call メソ...
...初の 3 の倍数を探す
p [1, 2, 3, 4, 5].find {|i| i % 3 == 0 } # => 3
p [2, 2, 2, 2, 2].find {|i| i % 3 == 0 } # => nil

# ifnone の使用例
ifnone = proc { raise ArgumentError, "item not found" }
p [1, 2, 3, 4, 5].find(ifnone) {|i| i % 7 == 0 }
# ArgumentError: item not found
//}...

PP.sharing_detection -> bool (12300.0)

共有検出フラグを表すアクセサです。 デフォルトは false です。true である場合、 PP.pp は一度出力したオブジェクトを再び出力する時 Object#pretty_print_cycle を使います。

...le を使います。

@param boolean 共有検出フラグを true か false で指定します。

//emlist[][ruby]{
require 'pp'

b = [1, 2, 3]
a = [b, b]

pp a #=> [[1, 2, 3], [1, 2, 3]]

PP.sharing_detection = true
pp a #=> [[1, 2, 3], [...]]
//}...
...etty_print_cycle を使います。

@param boolean 共有検出フラグを true か false で指定します。

//emlist[][ruby]{
b = [1, 2, 3]
a = [b, b]

pp a #=> [[1, 2, 3], [1, 2, 3]]

PP.sharing_detection = true
pp a #=> [[1, 2, 3], [...]]
//}...

Enumerable#find(ifnone = nil) -> Enumerator (3202.0)

要素に対してブロックを評価した値が真になった最初の要素を返します。

...らず、ifnone も指定されていないときは nil を返します。
真になる要素が見つからず、ifnone が指定されているときは ifnone を call した結果を返します。

ブロックを省略した場合は Enumerator を返します。

@param ifnone call メソ...
...初の 3 の倍数を探す
p [1, 2, 3, 4, 5].find {|i| i % 3 == 0 } # => 3
p [2, 2, 2, 2, 2].find {|i| i % 3 == 0 } # => nil

# ifnone の使用例
ifnone = proc { raise ArgumentError, "item not found" }
p [1, 2, 3, 4, 5].find(ifnone) {|i| i % 7 == 0 }
# ArgumentError: item not found
//}...

Enumerable#find(ifnone = nil) {|item| ... } -> object (3202.0)

要素に対してブロックを評価した値が真になった最初の要素を返します。

...らず、ifnone も指定されていないときは nil を返します。
真になる要素が見つからず、ifnone が指定されているときは ifnone を call した結果を返します。

ブロックを省略した場合は Enumerator を返します。

@param ifnone call メソ...
...初の 3 の倍数を探す
p [1, 2, 3, 4, 5].find {|i| i % 3 == 0 } # => 3
p [2, 2, 2, 2, 2].find {|i| i % 3 == 0 } # => nil

# ifnone の使用例
ifnone = proc { raise ArgumentError, "item not found" }
p [1, 2, 3, 4, 5].find(ifnone) {|i| i % 7 == 0 }
# ArgumentError: item not found
//}...

絞り込み条件を変える

NEWS for Ruby 2.7.0 (372.0)

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

...は参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。

== 2.6.0 以降の変更

=== 言語仕様の変更

==== パターンマッチ

* パターンマ...
...p var #=> 1
end
//}

//emlist[][ruby]{
case -1
in 0 then :unreachable
in 1 then :unreachable
end #=> NoMatchingPatternError
//}

//emlist{
json = <<END
{
"name": "Alice",
"age": 30,
"children": [{ "name": "Bob", "age": 2 }]
}
END

JSON.parse(json, symbolize_names: true) in {name: "Alice", c...
...た。7877

//emlist[Enumerator.produce][ruby]{
require "date"
dates = Enumerator.produce(Date.today, &:succ) #=> infinite sequence of dates
dates.detect(&:tuesday?) #=> next Tuesday
//}
//emlist[Enumerator::Lazy#eager][ruby]{
a = %w(foo bar baz)
e = a.lazy.map {|x| x.upcase }.map {|x| x + "!" }.eag...

NEWS for Ruby 2.0.0 (132.0)

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

...は参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。

== 1.9.3 以降の変更

=== 言語仕様の変更

* キーワード引数を追加しました...
...拡張: File.fnmatch? は File::FNM_EXTGLOB(File::Constants::FNM_EXTGLOB) オプションが与えられていればブレースを展開します

* GC
* 改良:
* ビットマップマーキングを導入しました。Copy-on-Write を使用してページをコピーする...
...e は IO#wait の別名です。

* json
* 1.7.7 に更新

* net/http
* 新機能
* Proxies are now automatically detected from the http_proxy environment
variable. See Net::HTTP.new for details.
* gzip and deflate compression are now requested for all requests by...