class CodeRay::Encoders::Text

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

Constants

DEFAULT_OPTIONS
FILE_EXTENSION

Public Instance Methods

text_token(text, kind) click to toggle source
# File lib/coderay/encoders/text.rb, line 25
def text_token text, kind
  super
  
  if @first
    @first = false
  else
    @out << @sep
  end if @sep
end

Protected Instance Methods

setup(options) click to toggle source
# File lib/coderay/encoders/text.rb, line 36
def setup options
  super
  
  @first = true
  @sep = options[:separator]
end