diff options
Diffstat (limited to 'lib/pry/code.rb')
-rw-r--r-- | lib/pry/code.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/pry/code.rb b/lib/pry/code.rb index 037b5c45..7e08c76a 100644 --- a/lib/pry/code.rb +++ b/lib/pry/code.rb @@ -117,6 +117,16 @@ class Pry end end + # Filter the lines using the given block. + # + # @yield [LOC] + # @return [Code] + def reject(&block) + alter do + @lines = @lines.reject(&block) + end + end + # Remove all lines that aren't in the given range, expressed either as a # `Range` object or a first and last line number (inclusive). Negative # indices count from the end of the array of lines. |