class Dry::Monitor::SQL::Colorizers::Rouge

Attributes

formatter[R]
lexer[R]

Public Class Methods

new(theme) click to toggle source
# File lib/dry/monitor/sql/colorizers/rouge.rb, line 20
def initialize(theme)
  @formatter = ::Rouge::Formatters::Terminal256.new(theme || ::Rouge::Themes::Gruvbox.new)
  @lexer = ::Rouge::Lexers::SQL.new
end

Public Instance Methods

call(string) click to toggle source
# File lib/dry/monitor/sql/colorizers/rouge.rb, line 25
def call(string)
  formatter.format(lexer.lex(string))
end