Class: WAG::Global

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Encodable

#to_wasm, #to_wat

Constructor Details

#initialize(label, type) ⇒ Global

Returns a new instance of Global.



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

def initialize(label, type)
  @label = WAG::Label.from(label)
  @type = WAG::Type.from(type)
end

Instance Attribute Details

#labelObject (readonly)

Returns the value of attribute label.



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

def label
  @label
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#to_sexprObject



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

def to_sexpr
  [:global, label.to_sexpr, type.to_sexpr]
end