Class: Machete::Matchers::Quantifier
- Inherits:
-
Object
- Object
- Machete::Matchers::Quantifier
- Defined in:
- lib/machete/matchers.rb
Instance Attribute Summary collapse
-
#matcher ⇒ Object
readonly
:min should be always set, :max can be nil (meaning infinity).
-
#max ⇒ Object
readonly
:min should be always set, :max can be nil (meaning infinity).
-
#min ⇒ Object
readonly
:min should be always set, :max can be nil (meaning infinity).
-
#step ⇒ Object
readonly
:min should be always set, :max can be nil (meaning infinity).
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(matcher, min, max, step) ⇒ Quantifier
constructor
A new instance of Quantifier.
Constructor Details
#initialize(matcher, min, max, step) ⇒ Quantifier
Returns a new instance of Quantifier.
7 8 9 |
# File 'lib/machete/matchers.rb', line 7 def initialize(matcher, min, max, step) @matcher, @min, @max, @step = matcher, min, max, step end |
Instance Attribute Details
#matcher ⇒ Object (readonly)
:min should be always set, :max can be nil (meaning infinity)
5 6 7 |
# File 'lib/machete/matchers.rb', line 5 def matcher @matcher end |
#max ⇒ Object (readonly)
:min should be always set, :max can be nil (meaning infinity)
5 6 7 |
# File 'lib/machete/matchers.rb', line 5 def max @max end |
#min ⇒ Object (readonly)
:min should be always set, :max can be nil (meaning infinity)
5 6 7 |
# File 'lib/machete/matchers.rb', line 5 def min @min end |
#step ⇒ Object (readonly)
:min should be always set, :max can be nil (meaning infinity)
5 6 7 |
# File 'lib/machete/matchers.rb', line 5 def step @step end |
Instance Method Details
#==(other) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/machete/matchers.rb', line 11 def ==(other) other.instance_of?(self.class) && @matcher == other.matcher && @min == other.min && @max == other.max && @step == other.step end |