Module: Mustermann::Visualizer

Extended by:
Visualizer
Included in:
Visualizer
Defined in:
mustermann-contrib/lib/mustermann/visualizer.rb,
mustermann-contrib/lib/mustermann/visualizer/tree.rb,
mustermann-contrib/lib/mustermann/visualizer/highlight.rb,
mustermann-contrib/lib/mustermann/visualizer/highlighter.rb,
mustermann-contrib/lib/mustermann/visualizer/renderer/ansi.rb,
mustermann-contrib/lib/mustermann/visualizer/renderer/html.rb,
mustermann-contrib/lib/mustermann/visualizer/renderer/sexp.rb,
mustermann-contrib/lib/mustermann/visualizer/tree_renderer.rb,
mustermann-contrib/lib/mustermann/visualizer/highlighter/ast.rb,
mustermann-contrib/lib/mustermann/visualizer/renderer/generic.rb,
mustermann-contrib/lib/mustermann/visualizer/highlighter/dummy.rb,
mustermann-contrib/lib/mustermann/visualizer/pattern_extension.rb,
mustermann-contrib/lib/mustermann/visualizer/highlighter/ad_hoc.rb,
mustermann-contrib/lib/mustermann/visualizer/highlighter/regular.rb,
mustermann-contrib/lib/mustermann/visualizer/highlighter/composite.rb,
mustermann-contrib/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

22
23
24
# File 'mustermann-contrib/lib/mustermann/visualizer.rb', line 22

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

35
36
37
# File 'mustermann-contrib/lib/mustermann/visualizer.rb', line 35

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