るりまサーチ

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

別のキーワード

  1. matrix find_index
  2. _builtin find_index
  3. pathname find
  4. _builtin find

モジュール

検索結果

<< < ... 6 7 8 >>

Enumerator::Lazy#filter {|item| ... } -> Enumerator::Lazy (27.0)

Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。

...ror ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:find_all>

1.step.lazy.select { |i| i.even? }.take(10).force
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//...

Enumerator::Lazy#select {|item| ... } -> Enumerator::Lazy (27.0)

Enumerable#select と同じですが、配列ではなくEnumerator::Lazy を返します。

...ror ブロックを指定しなかった場合に発生します。

//emlist[例][ruby]{
1.step.lazy.find_all { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:find_all>

1.step.lazy.select { |i| i.even? }.take(10).force
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//...

Array#bsearch_index -> Enumerator (25.0)

ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値の位置を 二分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返します。self はあらかじめソートしておく必要があります。

...さい。

//emlist[例: find-minimum モード][ruby]{
ary = [0, 4, 7, 10, 12]
ary.bsearch_index { |x| x >= 4 } # => 1
ary.bsearch_index { |x| x >= 6 } # => 2
ary.bsearch_index { |x| x >= -1 } # => 0
ary.bsearch_index { |x| x >= 100 } # => nil
//}

//emlist[例: find-any モード][ruby]{
ary...

Array#bsearch_index { |x| ... } -> Integer | nil (25.0)

ブロックの評価結果で範囲内の各要素の判定を行い、条件を満たす値の位置を 二分探索(計算量は O(log n))で検索します。要素が見つからない場合は nil を返します。self はあらかじめソートしておく必要があります。

...さい。

//emlist[例: find-minimum モード][ruby]{
ary = [0, 4, 7, 10, 12]
ary.bsearch_index { |x| x >= 4 } # => 1
ary.bsearch_index { |x| x >= 6 } # => 2
ary.bsearch_index { |x| x >= -1 } # => 0
ary.bsearch_index { |x| x >= 100 } # => nil
//}

//emlist[例: find-any モード][ruby]{
ary...

Array#pack(template) -> String (13.0)

配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。

...emlist[][ruby]{
require 'socket'
official_hostname, alias_hostnames, address_family, *address_list = Socket.gethostbyname("localhost")
address_list.find {|address| address.size == 4 }.unpack("C4").join(".")
# => "127.0.0.1"

"127.0.0.1".split(".").collect {|c| c.to_i}.pack("C4")
# => "\x7F\x00\x00\x...

絞り込み条件を変える

Array#pack(template, buffer: String.new) -> String (13.0)

配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。

...emlist[][ruby]{
require 'socket'
official_hostname, alias_hostnames, address_family, *address_list = Socket.gethostbyname("localhost")
address_list.find {|address| address.size == 4 }.unpack("C4").join(".")
# => "127.0.0.1"

"127.0.0.1".split(".").collect {|c| c.to_i}.pack("C4")
# => "\x7F\x00\x00\x...

BasicObject#method_missing(name, *args) -> object (13.0)

呼びだされたメソッドが定義されていなかった時、Rubyインタプリタがこのメソッド を呼び出します。

...ng)
if name.to_s =~ /\Afind_(\d+)_in\z/
if @data[lang]
p @data[lang][$1.to_i]
else
raise "#{lang} unknown"
end
else
super
end
end
end

dic = Foo.new({:English => %w(zero one two), :Esperanto => %w(nulo unu du)})
dic.find_2_in :Esperanto #=> "du"...

Enumerable#lazy -> Enumerator::Lazy (13.0)

自身を lazy な Enumerator に変換したものを返します。

...(つまり、配列ではな
くEnumeratorを返す) ように再定義されています。

* map/collect
* flat_map/collect_concat
* select/find_all
* reject
* grep
* take, take_while
* drop, drop_while
* zip (※一貫性のため、ブロックを渡さないケースのみlazy)
* cyc...

Kernel#namespace(name = nil) { ... } -> Rake::NameSpace (13.0)

新しい名前空間を作成します。

...新しい名前空間を作成します。

与えられたブロックを評価する間は、その名前空間を使用します。

例:
ns = namespace "nested" do
task :run
end
task_run = ns[:run] # find :run in the given namespace.

@see Rake::TaskManager#in_namespace...

String#unpack(template) -> Array (13.0)

Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。

...emlist[][ruby]{
require 'socket'
official_hostname, alias_hostnames, address_family, *address_list = Socket.gethostbyname("localhost")
address_list.find {|address| address.size == 4 }.unpack("C4").join(".")
# => "127.0.0.1"

"127.0.0.1".split(".").collect {|c| c.to_i}.pack("C4")
# => "\x7F\x00\x00\x...

絞り込み条件を変える

<< < ... 6 7 8 >>