class CodeRay::Encoders::JSON

A simple JSON Encoder.

Example:

CodeRay.scan('puts "Hello world!"', :ruby).json

yields

[
  {"type"=>"text", "text"=>"puts", "kind"=>"ident"},
  {"type"=>"text", "text"=>" ", "kind"=>"space"},
  {"type"=>"block", "action"=>"open", "kind"=>"string"},
  {"type"=>"text", "text"=>"\"", "kind"=>"delimiter"},
  {"type"=>"text", "text"=>"Hello world!", "kind"=>"content"},
  {"type"=>"text", "text"=>"\"", "kind"=>"delimiter"},
  {"type"=>"block", "action"=>"close", "kind"=>"string"},
]