るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.159秒)
トップページ > 種類:インスタンスメソッド[x] > クエリ:r[x] > クエリ:ruby[x] > クエリ:@[x] > クエリ:JSON[x] > クラス:Date[x]

別のキーワード

  1. _builtin to_r
  2. open3 pipeline_r
  3. matrix elements_to_r
  4. fileutils rm_r
  5. fileutils cp_r

ライブラリ

検索結果

Date#to_json(*args) -> String (6291.0)

自身を JSON 形式の文字列に変換して返します。

...自身を JSON 形式の文字列に変換して返します。

内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。

@
param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡...
...されます。

//emlist[例][ruby]{
r
equire "json/add/core"

Date
.today.to_json
# => "{\"json_class\":\"Date\",\"y\":2018,\"m\":12,\"d\":11,\"sg\":2299161.0}"
//}

@
see JSON::Generator::GeneratorMethods::Hash#to_json...