2012/7/19 Torsten Robitzki <lists / ruby-forum.com>:
> Bartosz Dziewoski wrote in post #1069285:
>> Because that's how proper JSON is formatted? The toplevel "item" must
>> be an array or an object.
>
> From json.org, I read that a json value can be a string, a number, an
> object, an array, true, false or null. So I wonder, why "string" is
> treated different from []. By the way, "string".to_json works as
> expected:
>
>  > "string".to_json
>  => "\"string\""

So I looked around. The RFC clearly states, in section 2:
[https://tools.ietf.org/html/rfc4627]

   A JSON text is a serialized object or array.

      JSON-text = object / array


I think that "string".to_json is just an implementation quirk (there
is also 3.to_json etc.), which allows for prettier internal code 
#to_json on Array and Hash can be defined recursively.



-- Matma Rex