### Home Classes Methods

### In Files

- lib/v8/conversion/indentity.rb

### Methods

- #equate
- #rb_idmap
- #to_ruby
- #to_v8
- #v8_idmap

### Files

- Makefile

### Class/Module Index

Quicksearch

- V8
- V8::Access
- V8::Access::Indices
- V8::Access::Invocation
- V8::Access::Invocation::Aritize
- V8::Access::Invocation::Method
- V8::Access::Invocation::Proc
- V8::Access::Invocation::UnboundMethod
- V8::Access::Names
- V8::Array
- V8::C
- V8::Conversion
- V8::Conversion::Accessor
- V8::Conversion::Array
- V8::Conversion::Class
- V8::Conversion::Code
- V8::Conversion::Code::InvocationHandler
- V8::Conversion::Constructor
- V8::Conversion::Constructor::Args
- V8::Conversion::Fixnum
- V8::Conversion::Fundamental
- V8::Conversion::Get
- V8::Conversion::Hash
- V8::Conversion::IGet
- V8::Conversion::ISet
- V8::Conversion::Identity
- V8::Conversion::Method
- V8::Conversion::Method::MethodCache
- V8::Conversion::NativeDate
- V8::Conversion::NativeObject
- V8::Conversion::NativeString
- V8::Conversion::Object
- V8::Conversion::Primitive
- V8::Conversion::Proc
- V8::Conversion::Reference
- V8::Conversion::Set
- V8::Conversion::String
- V8::Conversion::Symbol
- V8::Conversion::Time
- V8::Error
- V8::Error::Protect
- V8::Error::Try
- V8::Function
- V8::Object
- V8::StackFrame
- V8::StackTrace
- V8::Weak
- V8::Weak::Cell
- V8::Weak::Cell::Storage
- V8::Weak::Ref
- V8::Weak::WeakValueMap
- Object
- UnboundMethod

No matching classes.

# V8::Conversion::Identity

### Public Instance Methods

equate(ruby_object, v8_object) click to toggle source

    # File lib/v8/conversion/indentity.rb, line 18
    def equate(ruby_object, v8_object)
      v8_idmap[v8_object.GetIdentityHash()] = ruby_object
      rb_idmap[ruby_object.object_id] = v8_object
    end

rb_idmap() click to toggle source

    # File lib/v8/conversion/indentity.rb, line 27
    def rb_idmap
      @ruby_idmap ||= V8::Weak::WeakValueMap.new
    end

to_ruby(v8_object) click to toggle source

    # File lib/v8/conversion/indentity.rb, line 5
    def to_ruby(v8_object)
      if v8_object.class <= V8::C::Object
        v8_idmap[v8_object.GetIdentityHash()] || super(v8_object)
      else
        super(v8_object)
      end
    end

to_v8(ruby_object) click to toggle source

    # File lib/v8/conversion/indentity.rb, line 13
    def to_v8(ruby_object)
      return super(ruby_object) if ruby_object.is_a?(String) || ruby_object.is_a?(Primitive)
      rb_idmap[ruby_object.object_id] || super(ruby_object)
    end

v8_idmap() click to toggle source

    # File lib/v8/conversion/indentity.rb, line 23
    def v8_idmap
      @v8_idmap ||= V8::Weak::WeakValueMap.new
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.