るりまサーチ (Ruby 2.2.0)

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

別のキーワード

  1. _builtin compact
  2. _builtin compact!
  3. array compact
  4. array compact!
  5. pretty compact

検索結果

Array#compact -> Array (54457.0)

compact は自身から nil を取り除いた配列を生成して返します。 compact! は自身から破壊的に nil を取り除き、変更が 行われた場合は self を、そうでなければ nil を返します。

compact は自身から nil を取り除いた配列を生成して返します。
compact! は自身から破壊的に nil を取り除き、変更が
行われた場合は self を、そうでなければ nil を返します。

//emlist[例][ruby]{
ary = [1, nil, 2, nil, 3, nil]
p ary.compact #=> [1, 2, 3]
p ary #=> [1, nil, 2, nil, 3, nil]
ary.compact!
p ary #=> [1, 2, 3]
p ary.compact! #=> nil
//...

REXML::Formatters::Pretty#compact -> bool (54322.0)

出力をコンパクトにするかどうかを返します。

出力をコンパクトにするかどうかを返します。

これが真の場合、出力の空白をできる限り削除しようとします。

デフォルト値は false です。

@see REXML::Formatters::Pretty#compact=

Array#compact! -> self | nil (18457.0)

compact は自身から nil を取り除いた配列を生成して返します。 compact! は自身から破壊的に nil を取り除き、変更が 行われた場合は self を、そうでなければ nil を返します。

compact は自身から nil を取り除いた配列を生成して返します。
compact! は自身から破壊的に nil を取り除き、変更が
行われた場合は self を、そうでなければ nil を返します。

//emlist[例][ruby]{
ary = [1, nil, 2, nil, 3, nil]
p ary.compact #=> [1, 2, 3]
p ary #=> [1, nil, 2, nil, 3, nil]
ary.compact!
p ary #=> [1, 2, 3]
p ary.compact! #=> nil
//...

REXML::Formatters::Pretty#compact=(c) (18322.0)

出力をコンパクトにするかどうかを設定します。

出力をコンパクトにするかどうかを設定します。

@param c コンパクトな出力をするかどうかを指定します。
@see REXML::Formatters::Pretty#compact

Gem::Indexer#compact_specs(specs) -> Array (18304.0)

与えられたスペックを元にスペックを一意に特定できるだけの情報を持った配列を作成して 返します。

与えられたスペックを元にスペックを一意に特定できるだけの情報を持った配列を作成して
返します。

@param specs Gem::Specification の配列を指定します。

絞り込み条件を変える

Enumerator::Lazy.new(obj, size=nil) {|yielder, *values| ... } -> Enumerator::Lazy (19.0)

Lazy Enumerator を作成します。Enumerator::Lazy#force メソッドなどに よって列挙が実行されたとき、objのeachメソッドが実行され、値が一つずつ ブロックに渡されます。ブロックは、yielder を使って最終的に yield される値を 指定できます。

Lazy Enumerator を作成します。Enumerator::Lazy#force メソッドなどに
よって列挙が実行されたとき、objのeachメソッドが実行され、値が一つずつ
ブロックに渡されます。ブロックは、yielder を使って最終的に yield される値を
指定できます。

//emlist[Enumerable#filter_map と、その遅延評価版を定義する例][ruby]{
module Enumerable
def filter_map(&block)
map(&block).compact
end
end

class Enumerator::...