GeoJSON is a JSON representation of Simple Feature geometries defined by Open Geospatial Consortium (OGC). Simple features is a standard for representing geographic objects. You can read the GeoJSON spec at: http://geojson.org/geojson-spec.html
This GeoJSON is an extension to the GeoRuby gem.
gem install nofxx-georuby
git clone [email protected]:sabman/geojson.git
cd geojson
irb
require 'geo_ruby'
require 'geojson'
geojson = '{ "type": "LineString", "coordinates": [ [100.0, 0.0], [101.0, 1.0] ] }'
# read geometry
geom = Geometry.from_geojson(geojson)
# write geometry
geom.to_json
You can see the tests for more examples