Ara Howard wrote:
> On Sep 14, 2008, at 4:19 AM, Gurpal 2000 wrote:
> 
>> I have another question. If I do something like this:
>>
>> mydata = [ C.new(4, 2).to_json, C.new(1, 3).to_json, C.new(5,  
>> 6).to_json
>> ]
>> myhash = { 'data' => mydata }
>> puts myhash.to_json
> 
> 
> 
> mydata = [  C.new(4, 2),  C.new(1, 3),  C.new(5, 6)  ]
> myhash = { 'data' => mydata }.to_json
> 
> a @ http://codeforpeople.com/

The funny thing is i've been trying that and it keeps on crapping out:

U:/ruby/lib/ruby/gems/1.8/gems/json_pure-1.1.3/lib/json/pure/generator.rb:300:in 
`to_json': wrong number of arguments (2 for 0) (ArgumentError)
  from 
U:/ruby/lib/ruby/gems/1.8/gems/json_pure-1.1.3/lib/json/pure/generator.rb:300:in 
`json_transform'
  from 
U:/ruby/lib/ruby/gems/1.8/gems/json_pure-1.1.3/lib/json/pure/generator.rb:299:in 
`map'
  from 
U:/ruby/lib/ruby/gems/1.8/gems/json_pure-1.1.3/lib/json/pure/generator.rb:299:in 
`json_transform'
  from 
U:/ruby/lib/ruby/gems/1.8/gems/json_pure-1.1.3/lib/json/pure/generator.rb:272:in 
`to_json'
  from 
U:/ruby/lib/ruby/gems/1.8/gems/json_pure-1.1.3/lib/json/pure/generator.rb:251:in 
`json_transform'
  from U:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in 
`map'
  from 
U:/ruby/lib/ruby/gems/1.8/gems/json_pure-1.1.3/lib/json/pure/generator.rb:245:in 
`each'
  from 
U:/ruby/lib/ruby/gems/1.8/gems/json_pure-1.1.3/lib/json/pure/generator.rb:245:in 
`map'
  from 
U:/ruby/lib/ruby/gems/1.8/gems/json_pure-1.1.3/lib/json/pure/generator.rb:245:in 
`json_transform'
  from 
U:/ruby/lib/ruby/gems/1.8/gems/json_pure-1.1.3/lib/json/pure/generator.rb:218:in 
`to_json'
  from Z:/test.rb:116
-- 
Posted via http://www.ruby-forum.com/.