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.
5 6 7 |
# File 'lib/pry/commands/ls/grep.rb', line 5 def initialize(grep_regexp) @grep_regexp = grep_regexp end |
Instance Method Details
#regexp ⇒ Object
9 10 11 12 13 14 15 16 17 |
# File 'lib/pry/commands/ls/grep.rb', line 9 def regexp proc { |x| if x.instance_of?(Array) x.grep(@grep_regexp) else x =~ @grep_regexp end } end |