Sha256: 97b33b94ba3ea8e230d45b6a98a648becb4bb9883e84ec72d621fbf20543cccb

Contents?: true

Size: 292 Bytes

Versions: 17

Compression:

Stored size: 292 Bytes

Contents

class V8::Object
  def to_hash
    to_hash0(self)
  end

  def to_hash0(obj)
    case obj
    when V8::Array
      obj.map {|v| to_hash0(v) }
    when V8::Object
      h = {}
      obj.each do |k, v|
        h[to_hash0(k)] = to_hash0(v)
      end
      h
    else
      obj
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
kumogata-0.5.12 lib/kumogata/v8_object_ext.rb
kumogata-0.5.11 lib/kumogata/v8_object_ext.rb
kumogata-0.5.10 lib/kumogata/v8_object_ext.rb
kumogata-0.5.9 lib/kumogata/v8_object_ext.rb
kumogata-0.5.8 lib/kumogata/v8_object_ext.rb
kumogata-0.5.7 lib/kumogata/v8_object_ext.rb
kumogata-0.5.6 lib/kumogata/v8_object_ext.rb
kumogata-0.5.5 lib/kumogata/v8_object_ext.rb
kumogata-0.5.4 lib/kumogata/v8_object_ext.rb
kumogata-0.5.3 lib/kumogata/v8_object_ext.rb
kumogata-0.5.2 lib/kumogata/v8_object_ext.rb
kumogata-0.5.2.beta2 lib/kumogata/v8_object_ext.rb
kumogata-0.5.2.beta lib/kumogata/v8_object_ext.rb
kumogata-0.5.1 lib/kumogata/v8_object_ext.rb
kumogata-0.5.0 lib/kumogata/v8_object_ext.rb
kumogata-0.4.19 lib/kumogata/v8_object_ext.rb
kumogata-0.4.18 lib/kumogata/v8_object_ext.rb