Class: V8::Portal::FunctionAdapter
Defined Under Namespace
Classes: BindAndCall, BoundCall, Call
Instance Attribute Summary collapse
-
#template ⇒ Object
readonly
Returns the value of attribute template.
Instance Method Summary collapse
- #function ⇒ Object
-
#initialize(portal, code) ⇒ FunctionAdapter
constructor
A new instance of FunctionAdapter.
Constructor Details
#initialize(portal, code) ⇒ FunctionAdapter
Returns a new instance of FunctionAdapter.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/v8/portal/function.rb', line 7 def initialize(portal, code) @portal = portal @caller = case code when Method then BoundCall.new(portal) when UnboundMethod then BindAndCall.new(portal) else Call.new(portal) end @code = code @template = V8::C::FunctionTemplate::New(@caller, @code) end |
Instance Attribute Details
#template ⇒ Object (readonly)
Returns the value of attribute template.
5 6 7 |
# File 'lib/v8/portal/function.rb', line 5 def template @template end |
Instance Method Details
#function ⇒ Object
18 19 20 |
# File 'lib/v8/portal/function.rb', line 18 def function @template.GetFunction() end |