Class CodeRay::Encoders::Text
In: lib/coderay/encoders/text.rb
Parent: Encoder

Concats the tokens into a single string, resulting in the original code string if no tokens were removed.

Alias: plain, plaintext

Options

:separator

A separator string to join the tokens.

Default: empty String

Methods

setup   text_token  

Constants

FILE_EXTENSION = 'txt'
DEFAULT_OPTIONS = { :separator => nil

Public Instance methods

[Source]

    # File lib/coderay/encoders/text.rb, line 25
25:     def text_token text, kind
26:       super
27:       
28:       if @first
29:         @first = false
30:       else
31:         @out << @sep
32:       end if @sep
33:     end

Protected Instance methods

[Source]

    # File lib/coderay/encoders/text.rb, line 36
36:     def setup options
37:       super
38:       
39:       @first = true
40:       @sep = options[:separator]
41:     end

[Validate]