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
-
#initialize(token, text, min, max, mode) ⇒ Quantifier
constructor
A new instance of Quantifier.
- #initialize_clone(other) ⇒ Object
- #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
#initialize_clone(other) ⇒ Object
14 15 16 17 |
# File 'lib/regexp_parser/expression/quantifier.rb', line 14 def initialize_clone(other) other.instance_variable_set(:@text, text.dup) super end |
#to_h ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/regexp_parser/expression/quantifier.rb', line 24 def to_h { token: token, text: text, mode: mode, min: min, max: max, } end |
#to_s ⇒ Object Also known as: to_str
19 20 21 |
# File 'lib/regexp_parser/expression/quantifier.rb', line 19 def to_s text.dup end |