Class: WAG::Result

Inherits:
Object
  • Object
show all
Includes:
Encodable
Defined in:
lib/wag/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Encodable

#to_wasm, #to_wat

Constructor Details

#initialize(*types) ⇒ Result

Returns a new instance of Result.



9
10
11
# File 'lib/wag/result.rb', line 9

def initialize(*types)
  @types = types.map { |t| WAG::Type.from(t) }
end

Instance Attribute Details

#typesObject (readonly)

Returns the value of attribute types.



7
8
9
# File 'lib/wag/result.rb', line 7

def types
  @types
end

Instance Method Details

#to_sexprObject



13
14
15
# File 'lib/wag/result.rb', line 13

def to_sexpr
  [:result].concat(types.map(&:to_sexpr))
end