Class: WAG::Table

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Encodable

#to_wasm, #to_wat

Constructor Details

#initialize(elements, type = :funcref) ⇒ Table

Returns a new instance of Table.



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

def initialize(elements, type = :funcref)
  @elements = elements
  @type = type
end

Instance Attribute Details

#elementsObject (readonly)

Returns the value of attribute elements.



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

def elements
  @elements
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#to_sexprObject



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

def to_sexpr
  [:table, elements, type]
end