Misc info on Ruby C extensions ...
The official example is here …
See the Ruby Resource book list and the PDF book on Extending Ruby …
Such a task is so complex that it does not lend well to teaching via a forum.
You have a large and steep learning curve to navigate. Needing to know C and learn Ruby (which is actually implemented in C/C++,) as well as learning how the SketchUp application works and it’s SKP document object model (which means learning it’s Ruby API.)
However, there are quite a few topic threads on this subject already in these Developer categories. (Use the search feature magnifying glass icon from within this category to find these old threads.)
Note that the C API is not yet “safe” to use to modify a live model object. (It has been first implemented to to operate on files for import / export to other 3rd party applications.)
This means that C extension must currently make Ruby API calls either via Ruby or Ruby’s C core rb_func_call
function.