356件ヒット
[201-300件を表示]
(0.091秒)
ライブラリ
- ビルトイン (260)
- bigdecimal (12)
- delegate (24)
- psych (24)
-
rubygems
/ source _ index (12) -
rubygems
/ specification (12) -
rubygems
/ version (12)
クラス
- BigDecimal (12)
- Class (12)
- Complex (12)
- Delegator (24)
-
Encoding
:: Converter (72) -
Encoding
:: InvalidByteSequenceError (12) -
Encoding
:: UndefinedConversionError (12) -
Gem
:: SourceIndex (12) -
Gem
:: Specification (12) -
Gem
:: Version (12) - Object (84)
-
Process
:: Status (12) - Random (24)
- Rational (12)
- String (32)
キーワード
-
_ dump (36) -
_ load (12) - clone (12)
- convert (12)
- coredump? (12)
- dup (12)
-
error
_ bytes (12) -
error
_ char (12) -
insert
_ output (12) - inspect (12)
-
marshal
_ dump (72) -
marshal
_ load (36) -
primitive
_ convert (48) -
psych
_ to _ yaml (12) -
to
_ yaml (12) - undump (8)
検索結果
先頭5件
- Random
# marshal _ load(array) -> Random - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer) -> Symbol - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset) -> Symbol - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol - Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol
-
Random
# marshal _ load(array) -> Random (135.0) -
Random#marshal_dump で得られた配列を基に、Randomオブジェクトを復元します。
...Random#marshal_dump で得られた配列を基に、Randomオブジェクトを復元します。
@param array 三要素以下からなる配列を指定します。
何を指定するかはRandom#marshal_dumpを参考にしてください。
@raise ArgumentError array が3より大......きい場合に発生します。
//emlist[例][ruby]{
r1 = Random.new(1)
a1 = r1.marshal_dump
r2 = Random.new(3)
r3 = r2.marshal_load(a1)
p r1 == r2 # => true
p r1 == r3 # => true
//}
@see Random#marshal_dump... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer) -> Symbol (125.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''
begin
ret = ec.primitive_convert(src, dst)
p [ret, src, dst, ec.primitive_errinfo]
case ret
when :invalid_byte_sequence
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
redo
when :undefi......rrinfo[1])
ec.insert_output('\x{%X:%s}' % [c.ord, c.encoding])
redo
when :incomplete_input
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
when :finished
end
break
end while nil
//}
不正なバイトや変換先で未定義なバイトをエスケープしつつ変換す... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset) -> Symbol (125.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''
begin
ret = ec.primitive_convert(src, dst)
p [ret, src, dst, ec.primitive_errinfo]
case ret
when :invalid_byte_sequence
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
redo
when :undefi......rrinfo[1])
ec.insert_output('\x{%X:%s}' % [c.ord, c.encoding])
redo
when :incomplete_input
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
when :finished
end
break
end while nil
//}
不正なバイトや変換先で未定義なバイトをエスケープしつつ変換す... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize) -> Symbol (125.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''
begin
ret = ec.primitive_convert(src, dst)
p [ret, src, dst, ec.primitive_errinfo]
case ret
when :invalid_byte_sequence
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
redo
when :undefi......rrinfo[1])
ec.insert_output('\x{%X:%s}' % [c.ord, c.encoding])
redo
when :incomplete_input
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
when :finished
end
break
end while nil
//}
不正なバイトや変換先で未定義なバイトをエスケープしつつ変換す... -
Encoding
:: Converter # primitive _ convert(source _ buffer , destination _ buffer , destination _ byteoffset , destination _ bytesize , options) -> Symbol (125.0) -
エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。
...Encoding::Converter.new("UTF-8", "EUC-JP")
src = "abc\x81あいう\u{20bb7}\xe3"
dst = ''
begin
ret = ec.primitive_convert(src, dst)
p [ret, src, dst, ec.primitive_errinfo]
case ret
when :invalid_byte_sequence
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
redo
when :undefi......rrinfo[1])
ec.insert_output('\x{%X:%s}' % [c.ord, c.encoding])
redo
when :incomplete_input
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
when :finished
end
break
end while nil
//}
不正なバイトや変換先で未定義なバイトをエスケープしつつ変換す... -
Encoding
:: UndefinedConversionError # error _ char -> String (119.0) -
エラーを発生させた1文字を文字列で返します。
...エラーを発生させた1文字を文字列で返します。
//emlist[例][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
begin
ec.convert("\u{a0}")
rescue Encoding::UndefinedConversionError
puts $!.error_char.dump #=> "\u{a0}"
end
//}... -
Class
# _ load(str) -> Class (117.0) -
Object#_dump を参照して下さい。
...Object#_dump を参照して下さい。
@param str Ruby のオブジェクトがダンプされた文字列を指定します。... -
Object
# clone(freeze: nil) -> object (113.0) -
オブジェクトの複製を作成して返します。
...y)といいます。
深い(deep)コピーが必要な場合には、
Marshalモジュールを利用して
//emlist[][ruby]{
Marshal.load(Marshal.dump(obj))
//}
このように複製を作成する方法があります。ただしMarshal出来ないオブジェクトが
含まれている場合に......は使えません。
//emlist[][ruby]{
obj = ["a","b","c"]
obj_d = obj.dup
obj_d[0] << "PLUS"
p obj #=> ["aPLUS", "b", "c"]
p obj_d #=> ["aPLUS", "b", "c"]
obj_m = Marshal.load(Marshal.dump(obj))
obj_m[1] << "PLUS"
p obj #=> ["aPLUS", "b", "c"]
p obj_m #=> ["aPLUS", "bPLUS", "c"]
//}... -
Object
# dup -> object (113.0) -
オブジェクトの複製を作成して返します。
...y)といいます。
深い(deep)コピーが必要な場合には、
Marshalモジュールを利用して
//emlist[][ruby]{
Marshal.load(Marshal.dump(obj))
//}
このように複製を作成する方法があります。ただしMarshal出来ないオブジェクトが
含まれている場合に......は使えません。
//emlist[][ruby]{
obj = ["a","b","c"]
obj_d = obj.dup
obj_d[0] << "PLUS"
p obj #=> ["aPLUS", "b", "c"]
p obj_d #=> ["aPLUS", "b", "c"]
obj_m = Marshal.load(Marshal.dump(obj))
obj_m[1] << "PLUS"
p obj #=> ["aPLUS", "b", "c"]
p obj_m #=> ["aPLUS", "bPLUS", "c"]
//}...