@EdwardJ82
There are many RB files [unencrypted text] available in the PluginStore,
https://sketchucation.com/pluginstore
There are also shorter 'snippets' attached to some posts in this forum.
You should get very simple examples and try to understand how they work.
You also need to understand how the API works...
https://ruby.sketchup.com/