Class: TwitterCldr::Utils::RegexpSampler
- Inherits:
-
Object
- Object
- TwitterCldr::Utils::RegexpSampler
- Defined in:
- lib/twitter_cldr/utils/regexp_sampler.rb
Overview
Generates a valid string that would match the given regexp ast.
Constant Summary collapse
- DIGITS =
('0'..'9').to_a
- WORD_LETTERS =
('a'..'z').to_a + ('A'..'Z').to_a + ['_']
Instance Attribute Summary collapse
-
#regexp_ast ⇒ Object
readonly
Returns the value of attribute regexp_ast.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(regexp_ast) ⇒ RegexpSampler
constructor
A new instance of RegexpSampler.
Constructor Details
#initialize(regexp_ast) ⇒ RegexpSampler
Returns a new instance of RegexpSampler.
17 18 19 |
# File 'lib/twitter_cldr/utils/regexp_sampler.rb', line 17 def initialize(regexp_ast) @regexp_ast = regexp_ast end |
Instance Attribute Details
#regexp_ast ⇒ Object (readonly)
Returns the value of attribute regexp_ast.
12 13 14 |
# File 'lib/twitter_cldr/utils/regexp_sampler.rb', line 12 def regexp_ast @regexp_ast end |
Instance Method Details
#generate ⇒ Object
21 22 23 |
# File 'lib/twitter_cldr/utils/regexp_sampler.rb', line 21 def generate walk_children(regexp_ast) end |