1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
module CodeRay module Encoders # = JSON Encoder class JSON < Encoder register_for :json FILE_EXTENSION = 'json' protected def compile tokens, options require 'json' @out = tokens.to_a.to_json end end end end