Class: TwitterCldr::Utils::RegexpAst::Node

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expressions, quantifier) ⇒ Node

Returns a new instance of Node.



23
24
25
26
# File 'lib/twitter_cldr/utils/regexp_ast.rb', line 23

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

Instance Attribute Details

#expressionsObject (readonly)

Returns the value of attribute expressions.



21
22
23
# File 'lib/twitter_cldr/utils/regexp_ast.rb', line 21

def expressions
  @expressions
end

#quantifierObject (readonly)

Returns the value of attribute quantifier.



21
22
23
# File 'lib/twitter_cldr/utils/regexp_ast.rb', line 21

def quantifier
  @quantifier
end

Class Method Details

.from_parser_node(node, expressions) ⇒ Object



32
33
34
# File 'lib/twitter_cldr/utils/regexp_ast.rb', line 32

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

Instance Method Details

#quantified?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/twitter_cldr/utils/regexp_ast.rb', line 28

def quantified?
  !!quantifier
end