Class: Regex::CharClass

Inherits:
PolyadicExpression show all
Defined in:
lib/regex/char_class.rb

Overview

Abstract class. A n-ary matching operator. It succeeds when one child expression succeeds to match the subject text.

Constant Summary collapse

Metachars =

These are characters with special meaning in character classes

']\^-'.codepoints

Instance Attribute Summary collapse

Attributes inherited from PolyadicExpression

#children

Attributes inherited from Expression

#begin_anchor, #end_anchor

Instance Method Summary collapse

Methods inherited from PolyadicExpression

#<<, #df_visitor, #done!, #lazy!

Methods inherited from CompoundExpression

#atomic?

Methods inherited from Expression

#atomic?, #options, #to_str

Constructor Details

#initialize(to_negate, *theChildren) ⇒ CharClass

Constructor.



15
16
17
18
# File 'lib/regex/char_class.rb', line 15

def initialize(to_negate, *theChildren)
  super(theChildren)
  @negated = to_negate
end

Instance Attribute Details

#negatedObject (readonly)

A flag that indicates whether the character is negated



12
13
14
# File 'lib/regex/char_class.rb', line 12

def negated
  @negated
end