Class: Regex::Expression
- Inherits:
-
Object
- Object
- Regex::Expression
- Defined in:
- lib/regex/expression.rb
Overview
Abstract class. The generalization of any valid regular (sub)expression.
Direct Known Subclasses
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#atomic? ⇒ Boolean
Abstract method.
-
#options(theParentOptions) ⇒ Object
Determine the matching options to apply to this object, given the options coming from the parent and options that are local to this object.
-
#to_str ⇒ String
Template method.
Instance Attribute Details
#begin_anchor ⇒ NilClass, Anchor
11 12 13 |
# File 'lib/regex/expression.rb', line 11 def begin_anchor @begin_anchor end |
#end_anchor ⇒ NilClass, Anchor
14 15 16 |
# File 'lib/regex/expression.rb', line 14 def end_anchor @end_anchor end |
Instance Method Details
#atomic? ⇒ Boolean
Abstract method. Return true iff the expression is atomic (= doesn't not have any child).
19 20 21 |
# File 'lib/regex/expression.rb', line 19 def atomic? abstract_method end |
#options(theParentOptions) ⇒ Object
Determine the matching options to apply to this object, given the options coming from the parent and options that are local to this object. Local options take precedence. by options with same name that are bound to this object.
28 29 30 |
# File 'lib/regex/expression.rb', line 28 def (theParentOptions) theParentOptions.merge(@local_options) end |
#to_str ⇒ String
Template method.
34 35 36 37 38 39 40 41 |
# File 'lib/regex/expression.rb', line 34 def to_str result = +'' result << prefix result << text_repr result << suffix result end |