Sha256: 39e42573f8290379ac85c39eb7e2a1c1eff53c4fac2f3dd68bcf3818c0fc01ca

Contents?: true

Size: 402 Bytes

Versions: 1

Compression:

Stored size: 402 Bytes

Contents

module V8
  class Object
    include Enumerable
    
    def initialize(native)
      @native = native
    end
    
    def [](key)
      To.ruby(@native.Get(key.to_s))
    end
    
    def []=(key, value)
      value.tap do
        @native.Set(key.to_s, value)
      end
    end
    
    def each
      for prop in @native.GetPropertyNames()
        yield prop, self[prop]
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
therubyracer-0.4.3 lib/v8/object.rb