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
-
#begin_anchor ⇒ Object
Returns the value of attribute begin_anchor.
-
#end_anchor ⇒ Object
Returns the value of attribute end_anchor.
Instance Method Summary collapse
-
#atomic? ⇒ Boolean
Abstract method.
-
#cardinality(_parent_options) ⇒ Object
Abstract method.
-
#initialize ⇒ Expression
constructor
Constructor.
-
#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 ⇒ Object
Template method.
Constructor Details
#initialize ⇒ Expression
Constructor
12 |
# File 'lib/regex/expression.rb', line 12 def initialize(); end |
Instance Attribute Details
#begin_anchor ⇒ Object
Returns the value of attribute begin_anchor.
8 9 10 |
# File 'lib/regex/expression.rb', line 8 def begin_anchor @begin_anchor end |
#end_anchor ⇒ Object
Returns the value of attribute end_anchor.
9 10 11 |
# File 'lib/regex/expression.rb', line 9 def end_anchor @end_anchor end |
Instance Method Details
#atomic? ⇒ Boolean
Abstract method. Return true iff the expression is atomic (= may not have any child).
16 17 18 |
# File 'lib/regex/expression.rb', line 16 def atomic?() abstract_method end |
#cardinality(_parent_options) ⇒ Object
Abstract method. Return the number of values that match this expression. [_parent_options] an Hash of matching options. They are overridden by options with same name that are bound to this object.
23 24 25 |
# File 'lib/regex/expression.rb', line 23 def cardinality() 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.
32 33 34 35 |
# File 'lib/regex/expression.rb', line 32 def (theParentOptions) = theParentOptions.merge(@local_options) return end |
#to_str ⇒ Object
Template method. Purpose: Return the String representation of the expression.
39 40 41 42 43 44 45 46 |
# File 'lib/regex/expression.rb', line 39 def to_str() result = '' result << prefix result << text_repr result << suffix return result end |