class Ronin::Support::Binary::CTypes::UnionType::Member

Represents a member within a union.

@api private

@since 1.0.0

Attributes

type[R]

The type of the member.

@return [Type]

Public Class Methods

new(type) click to toggle source

Initializes the member.

@param [Type] type

The type of the member.
# File lib/ronin/support/binary/ctypes/union_type.rb, line 54
def initialize(type)
  @type = type
end

Public Instance Methods

alignment() click to toggle source

The alignment, in bytes, of the member within the union.

@return [Integer]

# File lib/ronin/support/binary/ctypes/union_type.rb, line 84
def alignment
  @type.alignment
end
offset() click to toggle source

The offset of the member within the union.

@return [0]

@note This method is mainly for compatibility with {StructType::Member#offset}.

# File lib/ronin/support/binary/ctypes/union_type.rb, line 66
def offset
  0
end
size() click to toggle source

The size, in bytes, of the member within the union.

@return [Integer]

# File lib/ronin/support/binary/ctypes/union_type.rb, line 75
def size
  @type.size
end