るりまサーチ (Ruby 2.3.0)

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

キーワード

検索結果

Process::Status (76.0)

プロセスの終了ステータスを表すクラスです。 メソッド Process.#wait2 などの返り値として使われます。

プロセスの終了ステータスを表すクラスです。
メソッド Process.#wait2 などの返り値として使われます。

=== 使用例

wait を使用した例

fork { exit }
Process.wait
case
when $?.signaled?
p "child #{$?.pid} was killed by signal #{$?.termsig}"
if $?.coredump? # システムがこのステータスをサポートしてなければ常にfalse
p "child #{$?.pid} dumped core."
end
...

Numeric (40.0)

数値を表す抽象クラスです。Integer や Float などの数値クラス は Numeric のサブクラスとして実装されています。

...d
//}

また、任意桁の切上げ、切捨て、四捨五入を行うメソッドは以下のように
定義できます。

//emlist[][ruby]{
class
Numeric
def roundup(d=0)
x = 10**d
if self > 0
self.quo(x).ceil * x
else
self.quo(x).floor * x
end
end

def roun...