File: //opt/alt/ruby32/share/gems/doc/json-2.16.0/ri/JSON/dump-i.ri
U:RDoc::AnyMethod[iI" dump:ETI"JSON#dump;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"]Dumps +obj+ as a \JSON string, i.e. calls generate on the object and returns the result.;To:RDoc::Markup::BlankLine o;
; [I"MThe default options can be changed via method JSON.dump_default_options.;T@o:RDoc::Markup::List:
@type:BULLET:@items[o:RDoc::Markup::ListItem:@label0; [o;
; [I"@Argument +io+, if given, should respond to method +write+; ;TI"Athe \JSON \String is written to +io+, and +io+ is returned. ;TI"9If +io+ is not given, the \JSON \String is returned.;To;;0; [o;
; [I"TArgument +limit+, if given, is passed to JSON.generate as option +max_nesting+.;T@S:RDoc::Markup::Rule:weighti@o;
; [I"UWhen argument +io+ is not given, returns the \JSON \String generated from +obj+:;To:RDoc::Markup::Verbatim; [I";obj = {foo: [0, 1], bar: {baz: 2, bat: 3}, bam: :bad}
;TI"json = JSON.dump(obj)
;TI"Ojson # => "{\"foo\":[0,1],\"bar\":{\"baz\":2,\"bat\":3},\"bam\":\"bad\"}"
;T:@format0o;
; [I"TWhen argument +io+ is given, writes the \JSON \String to +io+ and returns +io+:;To;; [
I"path = 't.json'
;TI"$File.open(path, 'w') do |file|
;TI" JSON.dump(obj, file)
;TI"&end # => #<File:t.json (closed)>
;TI"puts File.read(path)
;T;0o;
; [I"Output:;To;; [I"6{"foo":[0,1],"bar":{"baz":2,"bat":3},"bam":"bad"};T;0:
@fileI"lib/json/common.rb;T:0@omit_headings_from_table_of_contents_below0I"+JSON.dump(obj, io = nil, limit = nil)
;T0[ I"1(obj, anIO = nil, limit = nil, kwargs = nil);T@9FI" JSON;TcRDoc::NormalModule00