load

load(source, proc = nil, options = {})
Instance Public methods

Load a ruby data structure from a JSON source and return it. A source can either be a string-like object, an IO-like object, or an object responding to the read method. If proc was given, it will be called with any nested Ruby object as an argument recursively in depth first order. To modify the default options pass in the optional options argument as well.

BEWARE: This method is meant to serialise data from trusted user input, like from your own database server or clients under your control, it could be dangerous to allow untrusted users to pass JSON sources into it. The default options for the parser can be changed via the ::load_default_options method.

This method is part of the implementation of the load/dump interface of Marshal and YAML.

restore

doc_ruby_on_rails
2015-04-17 06:12:42
Comments
Leave a Comment

Please login to continue.