Class: TwitterCldr::Utils::RegexpAst::Literal

Inherits:
Node
  • Object
show all
Defined in:
lib/twitter_cldr/utils/regexp_ast.rb

Direct Known Subclasses

EscapeSequence

Instance Attribute Summary collapse

Attributes inherited from Node

#expressions, #quantifier

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#quantified?

Constructor Details

#initialize(expressions, quantifier, text) ⇒ Literal

Returns a new instance of Literal.



75
76
77
78
# File 'lib/twitter_cldr/utils/regexp_ast.rb', line 75

def initialize(expressions, quantifier, text)
  @text = text
  super(expressions, quantifier)
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



73
74
75
# File 'lib/twitter_cldr/utils/regexp_ast.rb', line 73

def text
  @text
end

Class Method Details

.from_parser_node(node, expressions) ⇒ Object



80
81
82
83
84
# File 'lib/twitter_cldr/utils/regexp_ast.rb', line 80

def self.from_parser_node(node, expressions)
  new(
    expressions, Quantifier.from_parser_node(node), node.text
  )
end