@@ -332,17 +332,18 @@ void initialize()
332332 .define_iterator <std::vector<bmp::Pixel>::iterator (bmp::Bitmap::*)() noexcept >(
333333 &bmp::Bitmap::begin, &bmp::Bitmap::end, " each" )
334334
335- // Iterator accessors (less commonly used from Ruby)
336- .define_method ( " cbegin " , & bmp::Bitmap::cbegin)
337- . define_method ( " cend " , &bmp::Bitmap::cend)
335+ // Const iterator
336+ .define_iterator <std::vector<bmp::Pixel>:: const_iterator ( bmp::Bitmap::*)() const noexcept >(
337+ &bmp::Bitmap::cbegin , &bmp::Bitmap::cend, " each_const " )
338338
339339 // Reverse iterator: bitmap.each_reverse { |pixel| ... }
340340 .define_iterator <std::vector<bmp::Pixel>::reverse_iterator (bmp::Bitmap::*)() noexcept >(
341341 &bmp::Bitmap::rbegin, &bmp::Bitmap::rend, " each_reverse" )
342342
343- .define_method (" crbegin" , &bmp::Bitmap::crbegin)
344- .define_method (" crend" , &bmp::Bitmap::crend)
345-
343+ // Reverse const iterator: bitmap.each_reverse { |pixel| ... }
344+ .define_iterator <std::vector<bmp::Pixel>::const_reverse_iterator (bmp::Bitmap::*)() const noexcept >(
345+ &bmp::Bitmap::crbegin, &bmp::Bitmap::crend, " each_const_reverse" )
346+
346347 // --------------------------------------------------------------------
347348 // MODIFIER METHODS
348349 // --------------------------------------------------------------------
@@ -410,6 +411,10 @@ void Init_bitmap_plus_plus_ruby()
410411{
411412 Rice::detail::cpp_protect ([]
412413 {
414+ // Setup Ruby bindings
413415 initialize ();
416+
417+ // Setup introspection support to generate RBS signatures and documentation
418+ Init_Rice_Api ();
414419 });
415420}
0 commit comments