るりまサーチ

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

別のキーワード

  1. json to_json
  2. json state
  3. json parser
  4. json []
  5. json parse

クラス

キーワード

検索結果

<< < ... 9 10 11 12 13 ... > >>

JSON::State#indent -> String (3038.0)

インデントに使用する文字列を返します。

...インデントに使用する文字列を返します。

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

json
_state = JSON::State.new(indent: "\t")
json
_state.indent # => "\t"
JSON
.generate({key1: "value1", key2: "value2"}, json_state)
# => "{\t\"key1\":\"value1\",\t\"key2\":\"value2\"}"
//}...

JSON::State (3034.0)

Ruby オブジェクトから JSON 形式の文字列を生成する間、 JSON 形式の文字列を生成するための設定を保持しておくために使用するクラスです。

...Ruby オブジェクトから JSON 形式の文字列を生成する間、
JSON
形式の文字列を生成するための設定を保持しておくために使用するクラスです。...

JSON::State#generate(obj) -> String (3034.0)

Generates a valid JSON document from object obj and returns the result. If no valid JSON document can be created this method raises a GeneratorError exception.

...Generates a valid JSON document from object obj and returns the
result. If no valid JSON document can be created this method raises a
GeneratorError exception....

JSON::State#to_h -> Hash (3026.0)

自身をハッシュに変換します。

...自身をハッシュに変換します。

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

json
_state = JSON::State.new
pp json_state.to_h

# => {:indent=>"",
# :space=>"",
# :space_before=>"",
# :object_nl=>"",
# :array_nl=>"",
# :allow_nan=>false,
# :ascii_only=>false,...

JSON::State#to_hash -> Hash (3026.0)

自身をハッシュに変換します。

...自身をハッシュに変換します。

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

json
_state = JSON::State.new
pp json_state.to_h

# => {:indent=>"",
# :space=>"",
# :space_before=>"",
# :object_nl=>"",
# :array_nl=>"",
# :allow_nan=>false,
# :ascii_only=>false,...

絞り込み条件を変える

JSON::Parser#parse -> object (3020.0)

現在のソースをパースして結果を Ruby のオブジェクトとして返します。

...uby のオブジェクトとして返します。

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

class Person
attr_accessor :name, :age

def []=(key, value)
instance_variable_set("@#{key}", value)
end
end

parser = JSON::Parser.new(DATA.read, object_class: Person)
person = parser.parse
person.class...
...# => Person
person.name # => "tanaka"
person.age # => 20

__END__
{
"name":"tanaka",
"age":20
}
//}

@see JSON::Parser#source...

JSON::CircularDatastructure (3018.0)

JSON 形式の文字列を生成するときに循環するデータ構造があるときに発生する例外です。

...JSON 形式の文字列を生成するときに循環するデータ構造があるときに発生する例外です。...

JSON::Ext::Generator::GeneratorMethods::Array (3018.0)

Alias of JSON::Generator::GeneratorMethods::Array

...Alias of JSON::Generator::GeneratorMethods::Array...

JSON::Ext::Generator::GeneratorMethods::FalseClass (3018.0)

Alias of JSON::Generator::GeneratorMethods::FalseClass

...Alias of JSON::Generator::GeneratorMethods::FalseClass...
<< < ... 9 10 11 12 13 ... > >>