Ruby 4.1 リファレンスマニュアル

instance method JSON::State#to_h

to_h -> HashRuby 1.9.3 から[permalink][rdoc][edit]
to_hash -> HashRuby 2.1.0 から

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

例
require "json"
require "pp"

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

# => {indent: "",
#     space: "",
#     space_before: "",
#     object_nl: "",
#     array_nl: "",
#     as_json: false,
#     allow_nan: false,
#     ascii_only: false,
#     max_nesting: 100,
#     script_safe: false,
#     strict: false,
#     depth: 0,
#     buffer_initial_length: 1024,
#     sort_keys: false,
#     rfc8785: false,
#     allow_duplicate_key: false}