るりまサーチ

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

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

キーワード

検索結果

<< < 1 2 >>

JSON.#load_file!(filespec, opts = {}) -> object (6220.0)

filespec で指定した JSON 形式のファイルを Ruby オブジェクトとしてロードして返します。

...filespec で指定した JSON 形式のファイルを Ruby オブジェクトとしてロードして返します。

@param filespec ファイル名を指定します。

@param options オプションをハッシュで指定します。指定可能なオプションは JSON.#parse! と同様で...
...す。

@see JSON.#parse!...

JSON.#load_file(filespec, opts = {}) -> object (6220.0)

filespec で指定した JSON 形式のファイルを Ruby オブジェクトとしてロードして返します。

...filespec で指定した JSON 形式のファイルを Ruby オブジェクトとしてロードして返します。

@param filespec ファイル名を指定します。

@param options オプションをハッシュで指定します。指定可能なオプションは JSON.#parse と同様で...
...す。

@see JSON.#parse...

JSON.#restore(source, proc = nil, options = {}) -> object (6220.0)

与えられた JSON 形式の文字列を Ruby オブジェクトとしてロードして返します。

... JSON 形式の文字列を Ruby オブジェクトとしてロードして返します。

proc として手続きオブジェクトが与えられた場合は、読み込んだオブジェクトを
引数にその手続きを呼び出します。


require 'json'

str=<<JSON
[1,2,3]
JSON
...
...

JSON
.load(str) # => [1,2,3]
JSON
.load(str, proc{|v| p v }) # => [1,2,3]
# 以下が表示される
# 1
# 2
# 3
# [1,2,3]

str=<<JSON
{ "a":1, "b":2, "c":3 }
JSON


JSON
.load(str) # => {"a"=>1, "b"=>2, "c"=>3}
JSON
.load(str, proc{|v| p v }) # => {"a"=>1, "b"=>2, "c"=>3}...
...3
# {"a"=>1, "b"=>2, "c"=>3}

@param source JSON 形式の文字列を指定します。他には、to_str, to_io, read メソッドを持つオブジェクトも指定可能です。

@param proc Proc オブジェクトを指定します。

@param options オプションをハッシュで指定...

JSON.#load(source, proc = nil, options = {}) -> object (220.0)

与えられた JSON 形式の文字列を Ruby オブジェクトとしてロードして返します。

... JSON 形式の文字列を Ruby オブジェクトとしてロードして返します。

proc として手続きオブジェクトが与えられた場合は、読み込んだオブジェクトを
引数にその手続きを呼び出します。


require 'json'

str=<<JSON
[1,2,3]
JSON
...
...

JSON
.load(str) # => [1,2,3]
JSON
.load(str, proc{|v| p v }) # => [1,2,3]
# 以下が表示される
# 1
# 2
# 3
# [1,2,3]

str=<<JSON
{ "a":1, "b":2, "c":3 }
JSON


JSON
.load(str) # => {"a"=>1, "b"=>2, "c"=>3}
JSON
.load(str, proc{|v| p v }) # => {"a"=>1, "b"=>2, "c"=>3}...
...3
# {"a"=>1, "b"=>2, "c"=>3}

@param source JSON 形式の文字列を指定します。他には、to_str, to_io, read メソッドを持つオブジェクトも指定可能です。

@param proc Proc オブジェクトを指定します。

@param options オプションをハッシュで指定...

JSON.#dump(object, io = nil, limit = nil) -> String | IO (216.0)

与えられたオブジェクトを JSON 形式の文字列に変換してダンプします。

...オブジェクトを JSON 形式の文字列に変換してダンプします。

与えられたオブジェクトを引数として JSON.#generate を呼び出します。


@param object ダンプするオブジェクトを指定します。

@param io IO のように write メソッドを実...
...m limit 指定した場合、limit 段以上深くリンクしたオブジェクトをダンプできません。

@raise ArgumentError オブジェクトのネストの深さが limit を越えた場合に発生します。

//emlist[例][ruby]{
require "json"

JSON
.dump({ name: "tanaka", age: 19 }...
...) # => "{\"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)
e
nd
//}

@see Marshal, Marshal.#du...

絞り込み条件を変える

<< < 1 2 >>