Class: Mustermann::Rails
- Inherits:
-
AST::Pattern
- Object
- Pattern
- RegexpBased
- AST::Pattern
- Mustermann::Rails
- Includes:
- AST::FastPattern
- Defined in:
- lib/mustermann/rails.rb
Overview
Rails style pattern implementation.
Constant Summary
Constants included from Mustermann
CompileError, DEFAULT_TYPE, Error, ExpandError, ParseError, TrieError
Instance Attribute Summary
Attributes inherited from RegexpBased
Attributes inherited from Pattern
Instance Method Summary collapse
-
#+(other) ⇒ Mustermann::Pattern
Creates a concatenated pattern by combingin self with the other pattern supplied.
-
#|(other) ⇒ Mustermann::Pattern
A composite pattern.
Methods included from AST::FastPattern
Methods inherited from AST::Pattern
ast_cache, #expand, #identity_params?, #to_templates
Methods inherited from RegexpBased
#initialize, #match, #params, #peek_match, #peek_size
Methods inherited from Pattern
#==, #===, #=~, #eql?, #expand, #hash, #identity_params?, #initialize, #match, #names, new, #params, #peek, #peek_match, #peek_params, #peek_size, supported?, supported_options, #to_proc, #to_s, #to_templates
Methods included from Mustermann
Constructor Details
This class inherits a constructor from Mustermann::RegexpBased
Instance Method Details
#+(other) ⇒ Mustermann::Pattern
Creates a concatenated pattern by combingin self with the other pattern supplied. Patterns of different types can be mixed. The availability of ‘to_templates` and `expand` depends on the patterns being concatenated.
String input is treated as identity pattern.
53 |
# File 'lib/mustermann/rails.rb', line 53 def +(other) = combine(other, :+) { super } |
#|(other) ⇒ Mustermann::Pattern #&(other) ⇒ Mustermann::Pattern #^(other) ⇒ Mustermann::Pattern
Returns a composite pattern.
50 |
# File 'lib/mustermann/rails.rb', line 50 def |(other) = combine(other, :|) { super } |