Class: YTLJit::AsmType::StructMember

Inherits:
TypeCommon show all
Defined in:
lib/ytljit/struct.rb

Instance Attribute Summary collapse

Attributes inherited from TypeCommon

#alignment, #type

Instance Method Summary collapse

Constructor Details

#initialize(type, offset) ⇒ StructMember

Returns a new instance of StructMember.



4
5
6
7
# File 'lib/ytljit/struct.rb', line 4

def initialize(type, offset)
  @type = type
  @offset = offset
end

Instance Attribute Details

#offsetObject (readonly)

Returns the value of attribute offset.



9
10
11
# File 'lib/ytljit/struct.rb', line 9

def offset
  @offset
end

Instance Method Details

#[](name) ⇒ Object



15
16
17
# File 'lib/ytljit/struct.rb', line 15

def [](name)
  @type[name, @offset]
end

#sizeObject



11
12
13
# File 'lib/ytljit/struct.rb', line 11

def size
  @type.size
end