ext/rect.c
void Init_ray_rect() {
  ray_cRect = rb_define_class_under(ray_mRay, "Rect", rb_cObject);

  rb_define_alloc_func(ray_cRect, ray_alloc_rect);
  rb_define_method(ray_cRect, "initialize", ray_init_rect, -1);
  rb_define_method(ray_cRect, "initialize_copy", ray_init_rect_copy, 1);

  rb_define_method(ray_cRect, "x", ray_rect_x, 0);
  rb_define_method(ray_cRect, "y", ray_rect_y, 0);
  rb_define_method(ray_cRect, "width", ray_rect_w, 0);
  rb_define_method(ray_cRect, "height", ray_rect_h, 0);

  rb_define_method(ray_cRect, "x=", ray_rect_set_x, 1);
  rb_define_method(ray_cRect, "y=", ray_rect_set_y, 1);
  rb_define_method(ray_cRect, "width=", ray_rect_set_w, 1);
  rb_define_method(ray_cRect, "height=", ray_rect_set_h, 1);
}
/*
  Document-class: Ray::Rect

  Rects are used to represent a part of an image, using
  two attributes to represent its position, and two
  others to represent its size.
*/
Document-class: Ray::Rect
Rects are used to represent a part of an image, using
two attributes to represent its position, and two
others to represent its size.
Document - class : Ray :: Rect Rects are used to represent a part of an image using two attributes to represent its position and two others to represent its size .
void Init_ray_rect() {
  ray_cRect = rb_define_class_under(ray_mRay, "Rect", rb_cObject);
  rb_define_alloc_func(ray_cRect, ray_alloc_rect);
  rb_define_method(ray_cRect, "initialize", ray_init_rect, -1);
  rb_define_method(ray_cRect, "initialize_copy", ray_init_rect_copy, 1);
  rb_define_method(ray_cRect, "x", ray_rect_x, 0);
  rb_define_method(ray_cRect, "y", ray_rect_y, 0);
  rb_define_method(ray_cRect, "width", ray_rect_w, 0);
  rb_define_method(ray_cRect, "height", ray_rect_h, 0);
  rb_define_method(ray_cRect, "x=", ray_rect_set_x, 1);
  rb_define_method(ray_cRect, "y=", ray_rect_set_y, 1);
  rb_define_method(ray_cRect, "width=", ray_rect_set_w, 1);
  rb_define_method(ray_cRect, "height=", ray_rect_set_h, 1);
}
void Init_ray_rect ( ) { ray_cRect = rb_define_class_under ( ray_mRay , " " , rb_cObject ) ; rb_define_alloc_func ( ray_cRect , ray_alloc_rect ) ; rb_define_method ( ray_cRect , " " , ray_init_rect , -1 ) ; rb_define_method ( ray_cRect , " " , ray_init_rect_copy , 1 ) ; rb_define_method ( ray_cRect , " " , ray_rect_x , 0 ) ; rb_define_method ( ray_cRect , " " , ray_rect_y , 0 ) ; rb_define_method ( ray_cRect , " " , ray_rect_w , 0 ) ; rb_define_method ( ray_cRect , " " , ray_rect_h , 0 ) ; rb_define_method ( ray_cRect , " " , ray_rect_set_x , 1 ) ; rb_define_method ( ray_cRect , " " , ray_rect_set_y , 1 ) ; rb_define_method ( ray_cRect , " " , ray_rect_set_w , 1 ) ; rb_define_method ( ray_cRect , " " , ray_rect_set_h , 1 ) ; }
Document-class: Ray::Rect
Rects are used to represent a part of an image, using
two attributes to represent its position, and two
others to represent its size.
Document - class : Ray :: Rect Rects are used to represent a part of an image using two attributes to represent its position and two others to represent its size .