class

Ecma335::CustomAttributeDecoder

Inherits Reference < Object

Constants

ELEMENT_BOOL = 2_u8
ELEMENT_BOXED = 81_u8
ELEMENT_CHAR = 3_u8
ELEMENT_ENUM = 85_u8
ELEMENT_FIELD = 83_u8
ELEMENT_I1 = 4_u8
ELEMENT_I2 = 6_u8
ELEMENT_I4 = 8_u8
ELEMENT_I8 = 10_u8
ELEMENT_PROP = 84_u8
ELEMENT_R4 = 12_u8
ELEMENT_R8 = 13_u8
ELEMENT_STRING = 14_u8
ELEMENT_SZARRAY = 29_u8
ELEMENT_TYPE = 80_u8
ELEMENT_U1 = 5_u8
ELEMENT_U2 = 7_u8
ELEMENT_U4 = 9_u8
ELEMENT_U8 = 11_u8

Instance methods

decode(blob : Bytes, type_name : String | Nil) : String | Nil

Legacy single-string rendering of an attribute blob. Kept for display and for attributes whose constructor signature is unknown.

Source
decode_args(blob : Bytes, ctor_param_types : Array(String)) : Tuple(Array(String), Hash(String, String)) | Nil

Structured decoding (ECMA-335 II.23.3). ctor_param_types are the constructor parameter types in signature-decoder notation ("int32", "string", "valuetype(X)", "class(System.Type)", "object", "szarray(T)"). Returns the fixed arguments in order plus the named arguments by name, or nil when the blob cannot be decoded with the given signature.

Source