Method: Struct#size

Defined in:
struct.c

#sizeInteger

Returns the number of members.

Customer = Struct.new(:name, :address, :zip)
joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
joe.size #=> 3

Returns:



1504
1505
1506
1507
1508
# File 'struct.c', line 1504

VALUE
rb_struct_size(VALUE s)
{
    return LONG2FIX(RSTRUCT_LEN(s));
}