Class: JsRegex::Converter::Base
- Inherits:
-
Object
- Object
- JsRegex::Converter::Base
- Defined in:
- lib/js_regex/converter/base.rb
Overview
Template class. Implement #convert_data in subclasses and return instance of String or Node from it.
Direct Known Subclasses
AnchorConverter, BackreferenceConverter, ConditionalConverter, EscapeConverter, FreespaceConverter, GroupConverter, KeepConverter, LiteralConverter, MetaConverter, PropertyConverter, SetConverter, SubexpressionConverter, TypeConverter, UnsupportedTokenConverter
Instance Method Summary collapse
-
#convert(expression, context) ⇒ Object
returns instance of Node with #quantifier attached.
Instance Method Details
#convert(expression, context) ⇒ Object
returns instance of Node with #quantifier attached.
9 10 11 12 13 14 15 16 |
# File 'lib/js_regex/converter/base.rb', line 9 def convert(expression, context) self.context = context self.expression = expression node = convert_data node = Node.new(node) if node.instance_of?(String) apply_quantifier(node) end |