Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/wwmd/class_extensions/extensions_base.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#each_grep(regex) ⇒ Object
grep each element of an array for the passed regular expression and return an Array of matches (only works one deep).
-
#to_file(filename) ⇒ Object
join the array with ānā and write to a file.
Instance Method Details
#each_grep(regex) ⇒ Object
grep each element of an array for the passed regular expression and return an Array of matches (only works one deep)
227 228 229 230 231 |
# File 'lib/wwmd/class_extensions/extensions_base.rb', line 227 def each_grep(regex) ret = [] self.each { |e| ret << e.grep(regex) } return ret end |