Class: Ronin::Support::Binary::CTypes::UnionType::Member Private

Inherits:
Object
  • Object
show all
Defined in:
lib/ronin/support/binary/ctypes/union_type.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Represents a member within a union.

Since:

  • 1.0.0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type) ⇒ Member

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initializes the member.

Parameters:

  • type (Type)

    The type of the member.

Since:

  • 1.0.0



54
55
56
# File 'lib/ronin/support/binary/ctypes/union_type.rb', line 54

def initialize(type)
  @type = type
end

Instance Attribute Details

#typeType (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The type of the member.

Returns:

Since:

  • 1.0.0



46
47
48
# File 'lib/ronin/support/binary/ctypes/union_type.rb', line 46

def type
  @type
end

Instance Method Details

#alignmentInteger

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

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

Returns:

Since:

  • 1.0.0



84
85
86
# File 'lib/ronin/support/binary/ctypes/union_type.rb', line 84

def alignment
  @type.alignment
end

#offset0

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Note:

This method is mainly for compatibility with

The offset of the member within the union.

StructType::Member#offset.

Returns:

  • (0)

Since:

  • 1.0.0



66
67
68
# File 'lib/ronin/support/binary/ctypes/union_type.rb', line 66

def offset
  0
end

#sizeInteger

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

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

Returns:

Since:

  • 1.0.0



75
76
77
# File 'lib/ronin/support/binary/ctypes/union_type.rb', line 75

def size
  @type.size
end