Class: Pry::Command::Ls::Grep
Instance Method Summary collapse
-
#initialize(grep_regexp) ⇒ Grep
constructor
A new instance of Grep.
- #regexp ⇒ Object
Constructor Details
#initialize(grep_regexp) ⇒ Grep
Returns a new instance of Grep.
7 8 9 |
# File 'lib/pry/commands/ls/grep.rb', line 7 def initialize(grep_regexp) @grep_regexp = grep_regexp end |
Instance Method Details
#regexp ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/pry/commands/ls/grep.rb', line 11 def regexp proc { |x| if x.instance_of?(Array) x.grep(@grep_regexp) else x =~ @grep_regexp end } end |