length()
public
Returns the number of instance variables.
Customer = Struct.new(:name, :address, :zip)
joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
joe.length
Show source
/*
* call-seq:
* struct.length => fixnum
* struct.size => fixnum
*
* Returns the number of instance variables.
*
* Customer = Struct.new(:name, :address, :zip)
* joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
* joe.length #=> 3
*/
static VALUE
rb_struct_size(s)
VALUE s;
{
return LONG2FIX(RSTRUCT(s)->len);
}