class Pry::Command::Ls::Grep - pry-0.10.1 Documentation

# class Pry::Command::Ls::Grep

### Public Class Methods

new(grep_regexp) click to toggle source

    # File lib/pry/commands/ls/grep.rb, line 5
    def initialize(grep_regexp)
      @grep_regexp = grep_regexp
    end

### Public Instance Methods

regexp() click to toggle source

    # 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