Module: Adhoq::QueryDecorator

Defined in:
app/decorators/adhoq/query_decorator.rb

Instance Method Summary collapse

Instance Method Details

#query_with_highlightObject



4
5
6
7
8
# File 'app/decorators/adhoq/query_decorator.rb', line 4

def query_with_highlight
  formatter = Rouge::Formatters::HTML.new(css_class: 'highlight query')
  lexer = Rouge::Lexers::SQL.new
  formatter.format(lexer.lex(query))
end