Class: Yargi::IndexPredicate
- Defined in:
- lib/yargi/predicate.rb
Overview
Index predicate
Constant Summary
Constants inherited from Predicate
Predicate::ALL, Predicate::NONE
Instance Method Summary collapse
- #===(elm) ⇒ Object
-
#initialize(index) ⇒ IndexPredicate
constructor
A new instance of IndexPredicate.
- #inspect ⇒ Object
Methods inherited from Predicate
#&, #not, to_predicate, #|
Constructor Details
#initialize(index) ⇒ IndexPredicate
Returns a new instance of IndexPredicate.
224 225 226 |
# File 'lib/yargi/predicate.rb', line 224 def initialize(index) @index = index end |
Instance Method Details
#===(elm) ⇒ Object
228 229 230 |
# File 'lib/yargi/predicate.rb', line 228 def ===(elm) elm.index == @index end |
#inspect ⇒ Object
232 233 234 |
# File 'lib/yargi/predicate.rb', line 232 def inspect "elm.index == #{index}" end |