module Agrep

Public Instance Methods

agrep(pattern) click to toggle source
# File lib/active_console/agrep.rb, line 2
def agrep(pattern)
  regex = Regexp.new pattern
  agrep = self.dup.select { |k, v| k.to_s =~ regex || v.to_s =~ regex }
  agrep.present? ? agrep : self
end