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