Class: TwitterCldr::Utils::RegexpAst::Quantifier

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(max, min) ⇒ Quantifier

Returns a new instance of Quantifier.



90
91
92
# File 'lib/twitter_cldr/utils/regexp_ast.rb', line 90

def initialize(max, min)
  @max = max; @min = min
end

Instance Attribute Details

#maxObject (readonly)

Returns the value of attribute max.



88
89
90
# File 'lib/twitter_cldr/utils/regexp_ast.rb', line 88

def max
  @max
end

#minObject (readonly)

Returns the value of attribute min.



88
89
90
# File 'lib/twitter_cldr/utils/regexp_ast.rb', line 88

def min
  @min
end

Class Method Details

.from_parser_node(node) ⇒ Object



94
95
96
97
98
99
100
101
# File 'lib/twitter_cldr/utils/regexp_ast.rb', line 94

def self.from_parser_node(node)
  if node.quantifier
    new(
      node.quantifier.max,
      node.quantifier.min
    )
  end
end