Watch this tutorial on The Unofficial SketchUp Plugins Blog demonstrating some basic techniques for writing SketchUp plugins in Ruby. It covers the workflow of editing, saving and loading a script using a simple example.
The tutorial does not cover learning the Ruby language, nor the SketchUp-Ruby API but some further links are provided.