Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/common/hacks.rb
Direct Known Subclasses
Instance Method Summary (collapse)
- - (Object) _grep_(regexp) (also: #grep)
Instance Method Details
- (Object) _grep_(regexp) Also known as: grep
20 21 22 23 24 25 26 27 |
# File 'lib/common/hacks.rb', line 20 def _grep_(regexp) matches = [] self.each do |value| value = value.to_s matches << value if value.match(regexp) end matches end |