opal/opal — Issue #30: Implemente `#to_native` in the various objects.
Author: meh
Created: 2011-12-12 21:41:18+00:00
State: open

`#to_native` should be the default way to get a native object from a Ruby object.

`Object#to_native` should return a JS object with the object instance variables as elements.
`Array#to_native` should return a map of self with `#to_native` called on every element that is a Ruby object.
`Hash#to_native` should return a JS object with as values `#to_native` called on every element that is a Ruby object.
`NilClass#to_native` should return `undefined`.