Class: WAG::Indices::Base

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

Direct Known Subclasses

Func, Global, Label, Local, Mem, Table, Type

Constant Summary collapse

RANGE =
[0..0xFFFFFFFF].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Base

Returns a new instance of Base.



9
10
11
12
13
# File 'lib/wag/indices/base.rb', line 9

def initialize(value)
  raise "Index 0x#{value.to_s(16)} does not fit in an i32" unless RANGE.cover?(value)

  @value = value
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end