Class: WAG::WAT

Inherits:
Object
  • Object
show all
Defined in:
lib/wag/wat.rb

Overview

A container for the WebAssembly text format.

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ WAT

Returns a new instance of WAT.



6
7
8
# File 'lib/wag/wat.rb', line 6

def initialize(source)
  @source = source
end

Instance Method Details

#to_sObject



14
15
16
# File 'lib/wag/wat.rb', line 14

def to_s
  @source
end

#to_wasmObject



10
11
12
# File 'lib/wag/wat.rb', line 10

def to_wasm
  WAG::WASM.new(WAG::WABT.new.wat2wasm(@source))
end