Module: Mustermann::Visualizer

Extended by:
Visualizer
Included in:
Visualizer
Defined in:
lib/mustermann/visualizer.rb,
lib/mustermann/visualizer/tree.rb,
lib/mustermann/visualizer/highlight.rb,
lib/mustermann/visualizer/highlighter.rb,
lib/mustermann/visualizer/renderer/ansi.rb,
lib/mustermann/visualizer/renderer/html.rb,
lib/mustermann/visualizer/renderer/sexp.rb,
lib/mustermann/visualizer/tree_renderer.rb,
lib/mustermann/visualizer/highlighter/ast.rb,
lib/mustermann/visualizer/renderer/generic.rb,
lib/mustermann/visualizer/highlighter/dummy.rb,
lib/mustermann/visualizer/pattern_extension.rb,
lib/mustermann/visualizer/highlighter/ad_hoc.rb,
lib/mustermann/visualizer/highlighter/regular.rb,
lib/mustermann/visualizer/highlighter/composite.rb,
lib/mustermann/visualizer/renderer/hansi_template.rb

Overview

Namespace for Mustermann visualization logic.

Defined Under Namespace

Modules: PatternExtension Classes: Highlight, Tree

Instance Method Summary collapse

Instance Method Details

#highlight(pattern, **options) ⇒ Mustermann::Visualizer::Highlight

Returns highlight object for given pattern.

Examples:

creating a highlight object

require 'mustermann/visualizer'

pattern   = Mustermann.new('/:name')
highlight = Mustermann::Visualizer.highlight(pattern)

puts highlight.to_ansi

Returns:



21
22
23
# File 'lib/mustermann/visualizer.rb', line 21

def highlight(pattern, **options)
  Highlight.new(pattern, **options)
end

#tree(pattern, **options) ⇒ Mustermann::Visualizer::Tree

Returns tree object for given pattern.

Examples:

creating a tree object

require 'mustermann/visualizer'

pattern = Mustermann.new('/:name')
tree    = Mustermann::Visualizer.tree(pattern)

puts highlight.to_s

Returns:



34
35
36
# File 'lib/mustermann/visualizer.rb', line 34

def tree(pattern, **options)
  TreeRenderer.render(pattern, **options)
end