class PrawnEncoder

Constants

COLORS

Public Instance Methods

begin_group(kind) click to toggle source
# File lib/coderay/prawn_encoder.rb, line 32
def begin_group(kind)
  @open << kind
end
end_group(kind) click to toggle source
# File lib/coderay/prawn_encoder.rb, line 36
def end_group(kind)
  @open.pop
end
setup(options) click to toggle source
Calls superclass method
# File lib/coderay/prawn_encoder.rb, line 20
def setup(options)
  super
  @out  = []
  @open = []
end
text_token(text, kind) click to toggle source
# File lib/coderay/prawn_encoder.rb, line 26
def text_token(text, kind)
  color = COLORS[kind] || COLORS[@open.last] || COLORS[:default]

  @out << {:text => text, :color => color}
end