Class: Relaton::Un::Wasm::Caller

Inherits:
Object
  • Object
show all
Defined in:
lib/relaton/un/wasm/interpreter.rb

Overview

The ‘caller` object passed to imported procs. Mirrors the shape the existing token_generator.rb expects: `caller.export(“memory”).to_memory` and `caller.export(“__wbindgen_malloc”).to_func`.

Instance Method Summary collapse

Constructor Details

#initialize(instance) ⇒ Caller

Returns a new instance of Caller.



26
27
28
# File 'lib/relaton/un/wasm/interpreter.rb', line 26

def initialize(instance)
  @instance = instance
end

Instance Method Details

#export(name) ⇒ Object



30
31
32
# File 'lib/relaton/un/wasm/interpreter.rb', line 30

def export(name)
  ExportRef.new(@instance, name)
end