You need to go through some tutorials and books. There are some that are specific for SketchUp.
Ruby Learning Resources [WikiLists]