260件ヒット
[1-100件を表示]
(0.105秒)
ライブラリ
- ビルトイン (194)
- bigdecimal (11)
- delegate (11)
-
rubygems
/ source _ index (11) -
rubygems
/ specification (11) -
rubygems
/ version (11) -
win32
/ registry (11)
クラス
- BigDecimal (11)
- Complex (11)
- Delegator (11)
-
Encoding
:: Converter (66) -
Encoding
:: InvalidByteSequenceError (11) -
Encoding
:: UndefinedConversionError (11) -
Gem
:: SourceIndex (11) -
Gem
:: Specification (11) -
Gem
:: Version (11) - Object (44)
-
Process
:: Status (11) - Random (11)
- Rational (11)
- String (18)
-
Win32
:: Registry (11)
キーワード
-
_ dump (44) - clone (11)
- convert (11)
- coredump? (11)
- dup (11)
-
error
_ bytes (11) -
error
_ char (11) -
insert
_ output (11) -
marshal
_ dump (66) -
primitive
_ convert (44) - undump (7)
検索結果
先頭5件
-
String
# dump -> String (24224.0) -
文字列中の非表示文字をバックスラッシュ記法に置き換えた文字列を返します。 str == eval(str.dump) となることが保証されています。
...に置き換えた文字列を返します。
str == eval(str.dump) となることが保証されています。
//emlist[例][ruby]{
# p だとさらにバックスラッシュが増えて見にくいので puts している
puts "abc\r\n\f\x00\b10\\\"".dump # => "abc\r\n\f\000\01010\\\""
//}......字列を返します。
str == eval(str.dump) となることが保証されています。
//emlist[例][ruby]{
# p だとさらにバックスラッシュが増えて見にくいので puts している
puts "abc\r\n\f\x00\b10\\\"".dump # => "abc\r\n\f\000\01010\\\""
//}
@see String#undump... -
Gem
:: SourceIndex # dump -> () (24218.0) -
自身を Marshal.#dump します。
...自身を Marshal.#dump します。... -
Object
# _ dump(limit) -> String (12330.0) -
Marshal.#dump において出力するオブジェクトがメソッド _dump を定義している場合には、そのメソッドの結果が書き出されます。
...Marshal.#dump において出力するオブジェクトがメソッド _dump
を定義している場合には、そのメソッドの結果が書き出されます。
バージョン1.8.0以降ではObject#marshal_dump, Object#marshal_loadの使用
が推奨されます。 Marshal.dump するオ......dump と marshal_dump の両方の
メソッドを持つ場合は marshal_dump が優先されます。
メソッド _dump は引数として再帰を制限するレベル limit を受
け取り、オブジェクトを文字列化したものを返します。
インスタンスがメソッド _du......帰の制限レベルを表す整数です。
@return オブジェクトを文字列化したものを返すように定義すべきです。
//emlist[][ruby]{
class Foo
def initialize(arg)
@foo = arg
end
def _dump(limit)
Marshal.dump(@foo, limit)
end
def self._load(obj)
p obj... -
Object
# marshal _ dump -> object (12308.0) -
Marshal.#dump を制御するメソッドです。
...Marshal.#dump を制御するメソッドです。
Marshal.dump(some) において、出力するオブジェクト some がメソッド marshal_dump を
持つ場合には、その返り値がダンプされたものが Marshal.dump(some) の返り値となります。
marshal_dump/marshal_load......の仕組みは Ruby 1.8.0 から導入されました。
これから書くプログラムでは _dump/_load ではなく
marshal_dump/marshal_load を使うべきです。
@return 任意のオブジェクトで marshal_load の引数に利用できます。
//emlist[][ruby]{
class Foo
def init......d
def marshal_dump
@foo
end
def marshal_load(obj)
p obj
@foo = obj
end
end
foo = Foo.new(['foo', 'bar'])
p foo #=> #<Foo:0xbaf3b0 @foo=["foo", "bar"]>
dms = Marshal.dump(foo)
p dms #=> "\004\bU:\bFoo[\a\"\bfoo\"\bbar"
result = Marshal.loa... -
Encoding
:: Converter # insert _ output(string) -> nil (12267.0) -
変換器内のバッファに文字列を挿入します。 バッファに保持された文字列は、次の変換時の変換結果と一緒に返されます。
...文字列
//emlist[][ruby]{
ec = Encoding::Converter.new("utf-8", "iso-8859-1")
src = "HIRAGANA LETTER A is \u{3042}."
dst = ""
p ec.primitive_convert(src, dst) #=> :undefined_conversion
puts "[#{dst.dump}, #{src.dump}]" #=> ["HIRAGANA LETTER A is ", "."]
ec.insert_output("<err>")
p ec.primiti......puts "[#{dst.dump}, #{src.dump}]" #=> ["HIRAGANA LETTER A is <err>.", ""]
ec = Encoding::Converter.new("utf-8", "iso-2022-jp")
src = "\u{306F 3041 3068 2661 3002}" # U+2661 is not representable in iso-2022-jp
dst = ""
p ec.primitive_convert(src, dst) #=> :undefined_conversion
puts "[#{dst.dump......}, #{src.dump}]" #=> ["\e$B$O$!$H".force_encoding("ISO-2022-JP"), "\xE3\ x80\x82"]
ec.insert_output "?" # state change required to output "?".
p ec.primitive_convert(src, dst) #=> :finished
puts "[#{dst.dump}, #{src.dump}]" #=> ["\e$B$O$!$H\e(B?\e$B!#\e(B".force_encoding("I... -
BigDecimal
# _ dump -> String (12230.0) -
BigDecimal._load で復元可能な文字列を返します。 Marshal.#dump から呼び出されます。
...Marshal.#dump から呼び出されます。
//emlist[][ruby]{
require 'bigdecimal'
inf = BigDecimal('Infinity') # => Infinity
s = Marshal.dump(inf) # => "\x04\bu:\x0FBigDecimal\x0F9:Infinity"
Marshal.load(s) # => Infinity
//}
@see BigDecimal._load, Marshal.#dump, Marshal.#loa... -
Gem
:: Specification # _ dump -> String (12224.0) -
重要なインスタンス変数のみを Marshal.#dump します。
...重要なインスタンス変数のみを Marshal.#dump します。
@see Marshal.#dump... -
String
# undump -> String (12213.0) -
self のエスケープを戻したものを返します。
...self のエスケープを戻したものを返します。
String#dump の逆変換にあたります。
//emlist[例][ruby]{
"\"hello \\n ''\"".undump #=> "hello \n ''"
//}
@see String#dump... -
Gem
:: Version # marshal _ dump -> Array (12208.0) -
完全なオブジェクトではなく、バージョン文字列のみダンプします。
...完全なオブジェクトではなく、バージョン文字列のみダンプします。
//emlist[][ruby]{
p Gem::Version.new('1.2.0a').marshal_dump # => ["1.2.0a"]
//}... -
Random
# marshal _ dump -> Array (12208.0) -
Random#marshal_load で復元可能な配列を返します。
...Random#marshal_load で復元可能な配列を返します。
//emlist[例][ruby]{
r1 = Random.new(1)
a1 = r1.marshal_dump
r2 = Random.new(3)
p r1 == r2 # => false
r3 = r2.marshal_load(a1)
p r1 == r2 # => true
p r1 == r3 # => true
//}...