# File 'lib/nwn/json_support.rb', line 28defself.dumpstruct,iod=ifNWN.setting(:pretty_json)::JSON.pretty_generate(struct)else::JSON.generate(struct)endio.putsdd.size+1end
.load(io) ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/nwn/json_support.rb', line 16defself.loadiojson=ifio.respond_to?(:to_str)io.to_strelsifio.respond_to?(:to_io)io.to_io.readelseio.readendNWN::Gff::Struct.unbox!(JSON.parse(json),nil)end