るりまサーチ

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

別のキーワード

  1. _builtin hash
  2. hash []
  3. dbm to_hash
  4. matrix hash
  5. _builtin to_hash

検索結果

<< 1 2 3 ... > >>

JSON::Ext::Generator::GeneratorMethods::Hash (18018.0)

Alias of JSON::Generator::GeneratorMethods::Hash

...Alias of JSON::Generator::GeneratorMethods::Hash...

JSON::Generator::GeneratorMethods::Hash (18018.0)

Hash に JSON で使用するインスタンスメソッドを追加するためのモジュールです。

...Hash JSON で使用するインスタンスメソッドを追加するためのモジュールです。...

JSON::State#to_hash -> Hash (3205.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::Generator::GeneratorMethods::Hash#to_json(state_or_hash = nil) -> String (3115.0)

自身から生成した JSON 形式の文字列を返します。

...から生成した JSON 形式の文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
JSON::State のインスタンスか、
JSON
::State.new の引数と同じ Hash...
...指定します。

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

person = { "name" => "tanaka", "age" => 19 }
person.to_json # => "{\"name\":\"tanaka\",\"age\":19}"
//}...

JSON::Generator::GeneratorMethods::Array#to_json(state_or_hash = nil) -> String (115.0)

自身から生成した JSON 形式の文字列を返します。

...から生成した JSON 形式の文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
JSON::State のインスタンスか、
JSON
::State.new の引数と同じ Hash...
...指定します。

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

[1, 2, 3].to_json # => "[1,2,3]"
//}...

絞り込み条件を変える

JSON::Generator::GeneratorMethods::FalseClass#to_json(state_or_hash = nil) -> String (115.0)

自身から生成した JSON 形式の文字列を返します。

...ら生成した JSON 形式の文字列を返します。

"false" という文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
JSON::State のインスタンスか、
JSON
::State.new...
...の引数と同じ Hash
指定します。

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

false.to_json # => "false"
//}...

JSON::Generator::GeneratorMethods::Float#to_json(state_or_hash = nil) -> String (115.0)

自身から生成した JSON 形式の文字列を返します。

...から生成した JSON 形式の文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
JSON::State のインスタンスか、
JSON
::State.new の引数と同じ Hash...
...指定します。

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

(1.0).to_json # => "1.0"
//}...

JSON::Generator::GeneratorMethods::Integer#to_json(state_or_hash = nil) -> String (115.0)

自身から生成した JSON 形式の文字列を返します。

...から生成した JSON 形式の文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
JSON::State のインスタンスか、
JSON
::State.new の引数と同じ Hash...
...指定します。

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

10.to_json # => "10"
//}...

JSON::Generator::GeneratorMethods::NilClass#to_json(state_or_hash = nil) -> String (115.0)

自身から生成した JSON 形式の文字列を返します。

...ら生成した JSON 形式の文字列を返します。

"null" という文字列を返します。

@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
JSON::State のインスタンスか、
JSON
::State.new の...
...引数と同じ Hash
指定します。

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

nil.to_json # => "null"
//}...

JSON::Generator::GeneratorMethods::Object#to_json(state_or_hash = nil) -> String (115.0)

自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。

...した結果を JSON 形式の文字列に変換して返します。

このメソッドはあるオブジェクトに to_json メソッドが定義されていない場合に使用する
フォールバックのためのメソッドです。

@param state_or_hash 生成する JSON 形式の文字...
...をカスタマイズするため
JSON::State のインスタンスか、
JSON
::State.new の引数と同じ Hash
指定します。

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

class Person
attr :name, :age

def initialize(name, ag...
...e)
@name, @age = name, age
end
end

tanaka = Person.new("tanaka", 29)

tanaka.to_json # => "\"#<Person:0x00007ffdec0167c8>\""
tanaka.method(:to_json).owner # => JSON::Ext::Generator::GeneratorMethods::Object
//}...

絞り込み条件を変える

<< 1 2 3 ... > >>