Class: Regexp::Expression::Quantifier
- Inherits:
-
Object
- Object
- Regexp::Expression::Quantifier
- Defined in:
- lib/regexp_parser/expression/quantifier.rb
Instance Attribute Summary collapse
-
#max ⇒ Object
readonly
Returns the value of attribute max.
-
#min ⇒ Object
readonly
Returns the value of attribute min.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
- #clone ⇒ Object
-
#initialize(token, text, min, max, mode) ⇒ Quantifier
constructor
A new instance of Quantifier.
- #to_h ⇒ Object
- #to_s ⇒ Object (also: #to_str)
Constructor Details
#initialize(token, text, min, max, mode) ⇒ Quantifier
Returns a new instance of Quantifier.
6 7 8 9 10 11 12 |
# File 'lib/regexp_parser/expression/quantifier.rb', line 6 def initialize(token, text, min, max, mode) @token = token @text = text @mode = mode @min = min @max = max end |
Instance Attribute Details
#max ⇒ Object (readonly)
Returns the value of attribute max.
4 5 6 |
# File 'lib/regexp_parser/expression/quantifier.rb', line 4 def max @max end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
4 5 6 |
# File 'lib/regexp_parser/expression/quantifier.rb', line 4 def min @min end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
4 5 6 |
# File 'lib/regexp_parser/expression/quantifier.rb', line 4 def mode @mode end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
4 5 6 |
# File 'lib/regexp_parser/expression/quantifier.rb', line 4 def text @text end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
4 5 6 |
# File 'lib/regexp_parser/expression/quantifier.rb', line 4 def token @token end |
Instance Method Details
#clone ⇒ Object
14 15 16 17 18 |
# File 'lib/regexp_parser/expression/quantifier.rb', line 14 def clone copy = self.dup copy.instance_variable_set(:@text, @text.dup) copy end |
#to_h ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/regexp_parser/expression/quantifier.rb', line 25 def to_h { :token => token, :text => text, :mode => mode, :min => min, :max => max } end |
#to_s ⇒ Object Also known as: to_str
20 21 22 |
# File 'lib/regexp_parser/expression/quantifier.rb', line 20 def to_s @text.dup end |