Method: Psych.to_json
- Defined in:
- lib/psych.rb
.to_json(object) ⇒ Object
Dump Ruby object to a JSON string.
605 606 607 608 609 |
# File 'lib/psych.rb', line 605 def self.to_json object visitor = Psych::Visitors::JSONTree.create visitor << object visitor.tree.yaml end |