1
0
Fork 0
mirror of https://github.com/rubyjs/therubyrhino synced 2023-03-27 23:21:34 -04:00

recursively To.ruby a native objects properties so that to_h will properly deal with nested objects

This commit is contained in:
Scott Fleckenstein 2010-05-27 06:24:59 +08:00 committed by Charles Lowell
parent 896f9f08a6
commit c1b8bd473a

View file

@ -57,6 +57,7 @@ module Rhino
def to_h
{}.tap do |h|
each do |k,v|
v = To.ruby(v)
h[k] = self.class === v ? v.to_h : v
end
end