るりまサーチ

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

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

キーワード

検索結果

<< < ... 6 7 8 9 10 ... > >>

Kernel.#BigDecimal(s) -> BigDecimal (14.0)

引数で指定した値を表す BigDecimal オブジェクトを生成します。

...値が採用されます。最大有
効桁数は以下のような割り算を実行するとき等に意味を持ちます。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1") / BigDecimal("3") # => 0.333333333333333333e0
BigDecimal("1",10) / BigDecimal("3",10) # => 0.333333333...

Kernel.#BigDecimal(s, exception: true) -> BigDecimal | nil (14.0)

引数で指定した値を表す BigDecimal オブジェクトを生成します。

...値が採用されます。最大有
効桁数は以下のような割り算を実行するとき等に意味を持ちます。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1") / BigDecimal("3") # => 0.333333333333333333e0
BigDecimal("1",10) / BigDecimal("3",10) # => 0.333333333...

Kernel.#BigDecimal(s, n) -> BigDecimal (14.0)

引数で指定した値を表す BigDecimal オブジェクトを生成します。

...値が採用されます。最大有
効桁数は以下のような割り算を実行するとき等に意味を持ちます。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1") / BigDecimal("3") # => 0.333333333333333333e0
BigDecimal("1",10) / BigDecimal("3",10) # => 0.333333333...

Kernel.#BigDecimal(s, n, exception: true) -> BigDecimal | nil (14.0)

引数で指定した値を表す BigDecimal オブジェクトを生成します。

...値が採用されます。最大有
効桁数は以下のような割り算を実行するとき等に意味を持ちます。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1") / BigDecimal("3") # => 0.333333333333333333e0
BigDecimal("1",10) / BigDecimal("3",10) # => 0.333333333...

Kernel.#Float(arg) -> Float (14.0)

引数を浮動小数点数(Float)に変換した結果を返します。

...ェクトを引数に指定したか、
to_f が浮動小数点数を返さなかった場合に発生します。

//emlist[例][ruby]{
p Float(4) #=> 4.0
p Float(4_000) #=> 4000.0
p Float(9.88) #=> 9.88

p Float(Time.gm(1986)) #=> 504921600.0
p Float(Obje...

絞り込み条件を変える

Kernel.#Float(arg, exception: true) -> Float | nil (14.0)

引数を浮動小数点数(Float)に変換した結果を返します。

...ェクトを引数に指定したか、
to_f が浮動小数点数を返さなかった場合に発生します。

//emlist[例][ruby]{
p Float(4) #=> 4.0
p Float(4_000) #=> 4000.0
p Float(9.88) #=> 9.88

p Float(Time.gm(1986)) #=> 504921600.0
p Float(Obje...

Kernel.#Hash(arg) -> Hash (14.0)

引数 arg で指定したオブジェクトを to_hash メソッドを呼び出す事で Hash オブジェクトに変換します。nil か [] を指定した場合は空の Hash オブジェクトを返します。

...した場合は空の
Hash オブジェクトを返します。

@param arg 変換対象のオブジェクトを指定します。

//emlist[例][ruby]{
Hash([]) # => {}
Hash(nil) # => {}
Hash(key: :value) # => {:key => :value}
Hash([1, 2, 3]) # => TypeError
//}

@raise TypeError...

Kernel.#Integer(arg, base = 0) -> Integer (14.0)

引数を整数 (Fixnum,Bignum) に変換した結果を返します。

...クラス)を返さなかった場合に発生します。
@raise TypeError 引数に nil を指定した場合に発生します。

//emlist[例][ruby]{
p Integer(4) #=> 4
p Integer(4_000) #=> 4000
p Integer(9.88) #=> 9

p Integer(nil) # can't convert nil into Integer (T...

Kernel.#Integer(arg, base = 0, exception: true) -> Integer | nil (14.0)

引数を整数 (Fixnum,Bignum) に変換した結果を返します。

...クラス)を返さなかった場合に発生します。
@raise TypeError 引数に nil を指定した場合に発生します。

//emlist[例][ruby]{
p Integer(4) #=> 4
p Integer(4_000) #=> 4000
p Integer(9.88) #=> 9

p Integer(nil) # can't convert nil into Integer (T...

Kernel.#String(arg) -> String (14.0)

引数を文字列(String)に変換した結果を返します。

...arg を返します。

@param arg 変換対象のオブジェクトです。
@raise TypeError to_s の返り値が文字列でなければ発生します。

//emlist[例][ruby]{
class Foo
def to_s
"hogehoge"
end
end

arg = Foo.new
p String(arg) #=> "hogehoge"
//}

@see Object#to_s,String...

絞り込み条件を変える

Kernel.#__callee__ -> Symbol | nil (14.0)

現在のメソッド名を返します。 メソッドの外で呼ばれると nil を返します。

...//emlist[例][ruby]{
def foo
p __callee__
end
alias :bar :foo
foo # => :foo
bar # => :bar
p __callee__ # => nil
//}

Kernel
.#__method__ とは異なり、現在のメソッド名が alias されたメ
ソッドの場合には alias 先のメソッド名を返します。

@see Kernel.#__method__...

Kernel.#__method__ -> Symbol | nil (14.0)

現在のメソッド名を返します。 メソッドの外で呼ばれると nil を返します。

...現在のメソッド名を返します。
メソッドの外で呼ばれると nil を返します。

//emlist[例][ruby]{
def foo
p __method__
end
alias :bar :foo
foo #=> :foo
bar #=> :foo
p __method__ #=> nil
//}

現在のメソッド名が alias されたメソッドの場合でも alias...

Kernel.#at_exit { ... } -> Proc (14.0)

与えられたブロックをインタプリタ終了時に実行します。

...Proc オブジェクトで返します。

//emlist[例][ruby]{
3.times do |i|
at_exit{puts "at_exit#{i}"}
end
END{puts "END"}
at_exit{puts "at_exit"}
puts "main_end"

#=> main_end
# at_exit
# END
# at_exit2
# at_exit1
# at_exit0
//}

@see d:spec/control#END,Kernel.#exit!,Kernel.#fork...
<< < ... 6 7 8 9 10 ... > >>