End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Psych.to_json
to_json(object)
ext/psych/lib/psych.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/ext/psych/lib/psych.rb, line 534
def self.to_json object
visitor = Psych::Visitors::JSONTree.create
visitor << object
visitor.tree.yaml
end
Dump Ruby object to a JSON string.
See also
.safe_load_file
.unsafe_load
.safe_load
.unsafe_load_file
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1