Sketchup.version_number class_method
Sketchup.version class_method
Checking SketchUp version in API - Developers / Ruby API - SketchUp Community