るりまサーチ

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

別のキーワード

  1. objectspace each_object
  2. _builtin each_object
  3. object send
  4. object to_enum
  5. object enum_for

ライブラリ

モジュール

キーワード

検索結果

<< < 1 2 3 >>

Marshal.#restore(port, proc = nil) -> object (109.0)

port からマーシャルデータを読み込んで、元のオブジェクトと同 じ状態をもつオブジェクトを生成します。

...)

# => "a"
# 1
# 10000000000
# 1.0
# :foo
# ["a", 1, 10000000000, 1.0, :foo]
# ["a", 1, 10000000000, 1.0, :foo]
//}

@param port String か IO (またはそのサブクラス)の
インスタンスを指定します。

@param proc 手続きオブジェクト。Proc

@...

Kernel.#open(name, mode = &#39;r&#39;, perm = nil, options = {}) -> StringIO | Tempfile | IO (102.0)

name が http:// や ftp:// で始まっている文字列なら URI のリソースを 取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。 返されるオブジェクトは OpenURI::Meta モジュールで extend されています。

...name が http:// や ftp:// で始まっている文字列なら URI のリソースを
取得した上で StringIO オブジェクトまたは Tempfile オブジェクトとして返します。
返されるオブジェクトは OpenURI::Meta モジュールで extend されています。

name...
...えた場合は上の場合と同様、name が http:// や ftp:// で
始まっている文字列なら URI のリソースを取得した上で StringIO オブジェクト
または Tempfile オブジェクトを引数としてブロックを評価します。後は同様です。
引数のオブ...

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

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

...teger(4_000) #=> 4000
p Integer(9.88) #=> 9

p Integer(nil) # can't convert nil into Integer (TypeError)
p Integer(Object.new) # cannot convert Object into Integer (TypeError)

p Integer("10") #=> 10
p Integer("10", 2) #=> 2
p Integer("0d10") #=> 10
p Integer("010")...
...teger("1\n0") # `Integer': invalid value for Integer: "1\n0" (ArgumentError)
p Integer("hoge") # `Integer': invalid value for Integer: "hoge" (ArgumentError)
p Integer("") # `Integer': invalid value for Integer: "" (ArgumentError)
//}

@see String#hex,String#oct,String#to_i,Integer...

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

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

...teger(4_000) #=> 4000
p Integer(9.88) #=> 9

p Integer(nil) # can't convert nil into Integer (TypeError)
p Integer(Object.new) # cannot convert Object into Integer (TypeError)

p Integer("10") #=> 10
p Integer("10", 2) #=> 2
p Integer("0d10") #=> 10
p Integer("010")...
...teger("1\n0") # `Integer': invalid value for Integer: "1\n0" (ArgumentError)
p Integer("hoge") # `Integer': invalid value for Integer: "hoge" (ArgumentError)
p Integer("") # `Integer': invalid value for Integer: "" (ArgumentError)
//}

@see String#hex,String#oct,String#to_i,Integer...

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

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

...換し、文字列の場合
は整数や浮動小数点数と見なせるもののみ変換します。

メソッド Float は文字列に対し String#to_f よりも厳密な変換を行います。

@param arg 変換対象のオブジェクトです。
@raise ArgumentError 整数や浮動小数...
...#=> 4.0
p Float(4_000) #=> 4000.0
p Float(9.88) #=> 9.88

p Float(Time.gm(1986)) #=> 504921600.0
p Float(Object.new) # can't convert Object into Float (TypeError)
p Float(nil) # can't convert nil into Float (TypeError)

p Float("10") #=> 10.0
p Float("10...
...alid value for Float(): "0xa.a" (ArgumentError)
p Float(" \n10\s \t") #=> 10.0 # 先頭と末尾の空白類は無視される
p Float("1\n0") # invalid value for Float(): "1\n0" (ArgumentError)
p Float("") # invalid value for Float(): "" (ArgumentError)
//}

@see String#to_f,Float...

絞り込み条件を変える

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

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

...換し、文字列の場合
は整数や浮動小数点数と見なせるもののみ変換します。

メソッド Float は文字列に対し String#to_f よりも厳密な変換を行います。

@param arg 変換対象のオブジェクトです。
@param exception false を指定すると、...
...#=> 4.0
p Float(4_000) #=> 4000.0
p Float(9.88) #=> 9.88

p Float(Time.gm(1986)) #=> 504921600.0
p Float(Object.new) # can't convert Object into Float (TypeError)
p Float(nil) # can't convert nil into Float (TypeError)

p Float("10") #=> 10.0
p Float("10...
...alid value for Float(): "0xa.a" (ArgumentError)
p Float(" \n10\s \t") #=> 10.0 # 先頭と末尾の空白類は無視される
p Float("1\n0") # invalid value for Float(): "1\n0" (ArgumentError)
p Float("") # invalid value for Float(): "" (ArgumentError)
//}

@see String#to_f,Float...

Marshal.#dump(obj, port, limit = -1) -> IO (20.0)

obj を指定された出力先に再帰的に出力します。

...と深さチェックを行いません。
デフォルトは -1 です。

@return port を省略すると、obj をダンプした String を返します。
port を指定すると port を返します。

@raise TypeError ファイルに書き出せないオブジェク...
...オブジェクトをダンプしようとした場合に発生します。

@raise ArgumentError limit 段以上深くリンクしたオブジェクトをダンプしようと
した場合に発生します。

@see Object#marshal_dump, Object#marshal_load...
<< < 1 2 3 >>