Module: V8::Conversion::Reference

Defined in:
lib/v8/conversion/reference.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.construct!(object) ⇒ Object



4
5
6
7
8
9
# File 'lib/v8/conversion/reference.rb', line 4

def self.construct!(object)
  context = V8::Context.current
  constructor = context.to_v8(object.class)
  reference = constructor.NewInstance([V8::C::External::New(object)])
  return reference
end

Instance Method Details

#to_v8Object



11
12
13
# File 'lib/v8/conversion/reference.rb', line 11

def to_v8
  Reference.construct! self
end