summaryrefslogtreecommitdiff
path: root/lib/coderay/encoders/json.rb
blob: 6d789c6d539ecb64d90d9829b9589e8bc0c9a391 (plain)
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