Class: Relaton::Un::Wasm::ExportRef

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#instanceObject

Returns the value of attribute instance

Returns:

  • (Object)

    the current value of instance



35
36
37
# File 'lib/relaton/un/wasm/interpreter.rb', line 35

def instance
  @instance
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



35
36
37
# File 'lib/relaton/un/wasm/interpreter.rb', line 35

def name
  @name
end

Instance Method Details

#to_funcObject



38
39
40
41
# File 'lib/relaton/un/wasm/interpreter.rb', line 38

def to_func
  func_idx = instance.export_index(name, :func)
  ->(*args) { instance.invoke_by_index(func_idx, args) }
end

#to_memoryObject



36
# File 'lib/relaton/un/wasm/interpreter.rb', line 36

def to_memory; MemoryAdapter.new(instance.memory); end