513件ヒット
[1-100件を表示]
(0.077秒)
ライブラリ
- ビルトイン (308)
- bigdecimal (22)
- delegate (22)
- json (11)
-
net
/ telnet (4) - psych (61)
-
rubygems
/ version (11) -
yaml
/ store (30)
クラス
- BigDecimal (22)
- Class (11)
- Complex (11)
- Delegator (22)
-
Encoding
:: Converter (55) -
Encoding
:: InvalidByteSequenceError (11) -
Gem
:: Version (11) -
Net
:: Telnet (4) - Object (88)
-
Process
:: Status (11) -
Psych
:: Visitors :: YAMLTree (11) - Random (22)
- Rational (11)
-
YAML
:: Store (19)
キーワード
-
MAJOR
_ VERSION (11) -
MINOR
_ VERSION (11) - Marshal (11)
- Marshal フォーマット (11)
- Store (11)
-
_ dump (22) -
_ load (22) - clone (11)
- coredump? (11)
- dup (11)
-
error
_ bytes (11) -
insert
_ output (11) - irb (11)
- load (11)
-
marshal
_ dump (66) -
marshal
_ load (33) - new (34)
-
primitive
_ convert (44) -
psych
_ to _ yaml (11) - restore (11)
-
ruby 1
. 8 . 2 feature (11) -
safe
_ load (17) - spawn (44)
-
to
_ yaml (11) - yaml (11)
-
yaml
_ tag (11)
検索結果
先頭5件
-
Marshal
. # dump(obj , limit = -1) -> String (21226.0) -
obj を指定された出力先に再帰的に出力します。
...い Class/Module オブジェクト。(この場
合は、例外 ArgumentError が発生します。無名クラスについて
は、Module.new を参照。)
* システムがオブジェクトの状態を保持するもの。具体的には以下のイン
スタンス。Dir, File::Stat,......IO とそのサブクラス
File, Socket など。
* MatchData, Data, Method, UnboundMethod,
Proc, Thread, ThreadGroup, Continuation
のインスタンス。
* 特異メソッドを定義したオブジェクト
また、これらのオブジェクトを間接的に指すオブジェク......るブロックを持った Hash は
Proc を間接的に指していることになります。
//emlist[例][ruby]{
p Marshal.dump(Hash.new {})
# => -:1:in `dump': cannot dump hash with default proc (TypeError)
//}
マーシャルの動作を任意に定義することもできます。
@param... -
Marshal
. # dump(obj , port , limit = -1) -> IO (21226.0) -
obj を指定された出力先に再帰的に出力します。
...い Class/Module オブジェクト。(この場
合は、例外 ArgumentError が発生します。無名クラスについて
は、Module.new を参照。)
* システムがオブジェクトの状態を保持するもの。具体的には以下のイン
スタンス。Dir, File::Stat,......IO とそのサブクラス
File, Socket など。
* MatchData, Data, Method, UnboundMethod,
Proc, Thread, ThreadGroup, Continuation
のインスタンス。
* 特異メソッドを定義したオブジェクト
また、これらのオブジェクトを間接的に指すオブジェク......るブロックを持った Hash は
Proc を間接的に指していることになります。
//emlist[例][ruby]{
p Marshal.dump(Hash.new {})
# => -:1:in `dump': cannot dump hash with default proc (TypeError)
//}
マーシャルの動作を任意に定義することもできます。
@param... -
JSON
. # dump(object , io = nil , limit = nil) -> String | IO (18225.0) -
与えられたオブジェクトを JSON 形式の文字列に変換してダンプします。
...す。
@param limit 指定した場合、limit 段以上深くリンクしたオブジェクトをダンプできません。
@raise ArgumentError オブジェクトのネストの深さが limit を越えた場合に発生します。
//emlist[例][ruby]{
require "json"
JSON.dump({ name: "tanak......=> "{\"name\":\"tanaka\",\"age\":19}"
//}
//emlist[例][ruby]{
require "json"
File.open("test.txt", "w") do |f|
JSON.dump([[[[[[[[[[]]]]]]]]]], f, 10) # => #<File:test.txt>
JSON.dump([[[[[[[[[[[]]]]]]]]]]], f, 10) # => exceed depth limit (ArgumentError)
end
//}
@see Marshal, Marshal.#dump... -
Object
# marshal _ dump -> object (12307.0) -
Marshal.#dump を制御するメソッドです。
...Marshal.#dump を制御するメソッドです。
Marshal.dump(some) において、出力するオブジェクト some がメソッド marshal_dump を
持つ場合には、その返り値がダンプされたものが Marshal.dump(some) の返り値となります。
marshal_dump/marshal_load......では _dump/_load ではなく
marshal_dump/marshal_load を使うべきです。
@return 任意のオブジェクトで marshal_load の引数に利用できます。
//emlist[][ruby]{
class Foo
def initialize(arg)
@foo = arg
end
def marshal_dump
@foo
end
def marshal_load(obj)......#=> #<Foo:0xbaf3b0 @foo=["foo", "bar"]>
dms = Marshal.dump(foo)
p dms #=> "\004\bU:\bFoo[\a\"\bfoo\"\bbar"
result = Marshal.load(dms) #=> ["foo", "bar"] # marshal_load の引数
p result #=> #<Foo:0xbaf2ac @foo=["foo", "bar"]>
//}
イン... -
Gem
:: Version # marshal _ dump -> Array (12207.0) -
完全なオブジェクトではなく、バージョン文字列のみダンプします。
...完全なオブジェクトではなく、バージョン文字列のみダンプします。
//emlist[][ruby]{
p Gem::Version.new('1.2.0a').marshal_dump # => ["1.2.0a"]
//}... -
Random
# marshal _ dump -> Array (12207.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
//}... -
Complex
# marshal _ dump -> Array (12201.0) -
Marshal.#load のためのメソッドです。 Complex::compatible#marshal_load で復元可能な配列を返します。
...Marshal.#load のためのメソッドです。
Complex::compatible#marshal_load で復元可能な配列を返します。
2.0 以降では Marshal.#load で 1.8 系の Complex オブジェクト
を保存した文字列も復元できます。
[注意] Complex::compatible は通常の方法で... -
Delegator
# marshal _ dump -> object (12201.0) -
シリアライゼーションをサポートするためにDelegator#__getobj__ が返すオブジェクトを返します。
...シリアライゼーションをサポートするためにDelegator#__getobj__ が返すオブジェクトを返します。... -
Rational
# marshal _ dump -> Array (12201.0) -
Marshal.#load のためのメソッドです。 Rational::compatible#marshal_load で復元可能な配列を返します。
...Marshal.#load のためのメソッドです。
Rational::compatible#marshal_load で復元可能な配列を返します。
[注意] Rational::compatible は通常の方法では参照する事ができません。... -
BigDecimal
# _ dump -> String (9129.0) -
BigDecimal._load で復元可能な文字列を返します。 Marshal.#dump から呼び出されます。
...BigDecimal._load で復元可能な文字列を返します。
Marshal.#dump から呼び出されます。
//emlist[][ruby]{
require 'bigdecimal'
inf = BigDecimal('Infinity') # => Infinity
s = Marshal.dump(inf) # => "\x04\bu:\x0FBigDecimal\x0F9:Infinity"
Marshal.load(s) # => I......nfinity
//}
@see BigDecimal._load, Marshal.#dump, Marshal.#load...