space_before -> String
[permalink][rdoc][edit]-
JSON 形式の文字列中で JavaScript のオブジェクトを表す部分にある ':' の前に挿入する文字列を返します。
require "json" json_state = JSON::State.new(space_before: "") json_state.space_before # => "" puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state) # => [1,2,{"name":"tanaka","age":19}] json_state = JSON::State.new(space_before: " ") json_state.space_before # => " " puts JSON.generate([1, 2, { name: "tanaka", age: 19 }], json_state) # => [1,2,{"name" :"tanaka","age" :19}]