Module: Mustermann
- Defined in:
- lib/mustermann.rb,
lib/mustermann/error.rb,
lib/mustermann/rails.rb,
lib/mustermann/shell.rb,
lib/mustermann/simple.rb,
lib/mustermann/pattern.rb,
lib/mustermann/sinatra.rb,
lib/mustermann/version.rb,
lib/mustermann/ast/node.rb,
lib/mustermann/identity.rb,
lib/mustermann/template.rb,
lib/mustermann/extension.rb,
lib/mustermann/ast/parser.rb,
lib/mustermann/ast/pattern.rb,
lib/mustermann/ast/compiler.rb,
lib/mustermann/ast/expander.rb,
lib/mustermann/regexp_based.rb,
lib/mustermann/simple_match.rb,
lib/mustermann/ast/translator.rb,
lib/mustermann/ast/validation.rb,
lib/mustermann/ast/transformer.rb,
lib/mustermann/ast/tree_renderer.rb
Overview
Namespace and main entry point for the Mustermann library.
Under normal circumstances the only external API entry point you should be using is Mustermann.new.
Defined Under Namespace
Modules: AST, Extension Classes: Identity, Pattern, Rails, RegexpBased, Shell, Simple, SimpleMatch, Sinatra, Template
Class Method Summary collapse
-
.[](key) ⇒ Class, #new
Maps a type to its factory.
-
.new(string, type: :sinatra, **options) ⇒ Mustermann::Pattern
Pattern corresponding to string.
Class Method Details
.[](key) ⇒ Class, #new
Maps a type to its factory.
23 24 25 26 27 |
# File 'lib/mustermann.rb', line 23 def self.[](key) constant, library = register.fetch(key) { raise ArgumentError, "unsupported type %p" % key } require library if library constant.respond_to?(:new) ? constant : register[key] = const_get(constant) end |
.new(string, type: :sinatra, **options) ⇒ Mustermann::Pattern
Returns pattern corresponding to string.
11 12 13 |
# File 'lib/mustermann.rb', line 11 def self.new(string, type: :sinatra, **) .any? ? self[type].new(string, **) : self[type].new(string) end |