Class: Nendo::LispRegexp
- Inherits:
-
Object
- Object
- Nendo::LispRegexp
- Defined in:
- lib/nendo.rb
Instance Attribute Summary collapse
-
#ignoreCase ⇒ Object
readonly
Returns the value of attribute ignoreCase.
Instance Method Summary collapse
- #escape ⇒ Object
-
#initialize(str) ⇒ LispRegexp
constructor
A new instance of LispRegexp.
- #to_s ⇒ Object
Constructor Details
#initialize(str) ⇒ LispRegexp
Returns a new instance of LispRegexp.
168 169 170 171 |
# File 'lib/nendo.rb', line 168 def initialize( str ) @exp = str[ 1 ... str.size ] @ignoreCase = (str[0] == 'i') end |
Instance Attribute Details
#ignoreCase ⇒ Object (readonly)
Returns the value of attribute ignoreCase.
178 179 180 |
# File 'lib/nendo.rb', line 178 def ignoreCase @ignoreCase end |
Instance Method Details
#escape ⇒ Object
175 176 177 |
# File 'lib/nendo.rb', line 175 def escape @exp.gsub( /\\/, "\\\\\\\\" ) end |
#to_s ⇒ Object
172 173 174 |
# File 'lib/nendo.rb', line 172 def to_s sprintf( "|%s|", @exp ) + (@ignoreCase ? "i" : "") end |