Class CodeRay::Encoders::JSON
In: lib/coderay/encoders/json.rb
Parent: Encoder

Methods

Constants

FILE_EXTENSION = 'json'

Protected Instance methods

[Source]

    # File lib/coderay/encoders/json.rb, line 26
26:     def block_token action, kind
27:       { :type => 'block', :action => action, :kind => kind }
28:     end

[Source]

    # File lib/coderay/encoders/json.rb, line 30
30:     def finish options
31:       @out.to_json
32:     end

[Source]

    # File lib/coderay/encoders/json.rb, line 12
12:     def setup options
13:       begin
14:         require 'json'
15:       rescue LoadError
16:         require 'rubygems'
17:         require 'json'
18:       end
19:       @out = []
20:     end

[Source]

    # File lib/coderay/encoders/json.rb, line 22
22:     def text_token text, kind
23:       { :type => 'text', :text => text, :kind => kind }
24:     end

[Validate]