class Rouge::Formatters::Terminal256
A formatter for 256-color terminals
Attributes
@private
Public Class Methods
Source
# File lib/rouge/formatters/terminal256.rb, line 14 def initialize(theme = Themes::ThankfulEyes.new) if theme.is_a?(Rouge::Theme) @theme = theme elsif theme.is_a?(Hash) @theme = theme[:theme] || Themes::ThankfulEyes.new else raise ArgumentError, "invalid theme: #{theme.inspect}" end end
@param [Hash,Rouge::Theme] theme
the theme to render with.
Public Instance Methods
Source
# File lib/rouge/formatters/terminal256.rb, line 24 def stream(tokens, &b) tokens.each do |tok, val| escape_sequence(tok).stream_value(val, &b) end end