Class: WAG::WASM
- Inherits:
-
Object
- Object
- WAG::WASM
- Defined in:
- lib/wag/wasm.rb
Overview
A container for the WebAssembly binary format.
Instance Method Summary collapse
-
#initialize(code) ⇒ WASM
constructor
A new instance of WASM.
- #save(path) ⇒ Object
- #to_s ⇒ Object
- #valid? ⇒ Boolean
Constructor Details
#initialize(code) ⇒ WASM
Returns a new instance of WASM.
6 7 8 |
# File 'lib/wag/wasm.rb', line 6 def initialize(code) @code = code end |
Instance Method Details
#save(path) ⇒ Object
14 15 16 |
# File 'lib/wag/wasm.rb', line 14 def save(path) File.write(path, @code) end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/wag/wasm.rb', line 18 def to_s @code end |
#valid? ⇒ Boolean
10 11 12 |
# File 'lib/wag/wasm.rb', line 10 def valid? WAG::WABT.new.wasm_validate(@code) end |