Ruby is an interpreted scripting language that SketchUp can understand via its SketchUp Ruby application programming interface (API). It was first introduced in SketchUp Version 4 with the intention to quick and easy object-oriented programming.
With ruby script sketchup users can use to write plugins (scripts) for Google SketchUp and develop extra functionality by creating dozens of new tools & component generators for SketchUp beyond its built-in abilities in the Ruby programming language.
Ruby scripts can be any thing from short snippets of code to more elaborate tool development.
for detailed discussion
http://www.sketchup4architect.com/articles/sketchup-ruby.htm