APIdock / Ruby
/
method

members

ruby latest stable - Class: Struct
members()
public

Returns the struct members as an array of symbols:

Customer = Struct .new (:name, :address, :zip)
joe = Customer.new ("Joe Smith", "123 Maple, Anytown NC", 12345)
joe.members  #=> [:name, :address, :zip]
static VALUE
rb_struct_members_m(VALUE obj)
{
 return rb_struct_s_members_m(rb_obj_class(obj));
}

AltStyle によって変換されたページ (->オリジナル) /