Class: Stackprofiler::Filter::FrameRegexRemoval
- Inherits:
-
Object
- Object
- Stackprofiler::Filter::FrameRegexRemoval
- Includes:
- RemoveFramesHelper
- Defined in:
- lib/stackprofiler/filters/frame_regex_removal.rb
Instance Method Summary collapse
- #filter(root, run) ⇒ Object
-
#initialize(options = {}) ⇒ FrameRegexRemoval
constructor
A new instance of FrameRegexRemoval.
- #regexes ⇒ Object
Methods included from RemoveFramesHelper
Constructor Details
#initialize(options = {}) ⇒ FrameRegexRemoval
Returns a new instance of FrameRegexRemoval.
6 7 8 |
# File 'lib/stackprofiler/filters/frame_regex_removal.rb', line 6 def initialize(={}) @options = end |
Instance Method Details
#filter(root, run) ⇒ Object
15 16 17 18 19 |
# File 'lib/stackprofiler/filters/frame_regex_removal.rb', line 15 def filter root, run remove_frames root, run do |node, frame| regexes.any? {|r| frame[:name] =~ r } end end |
#regexes ⇒ Object
10 11 12 13 |
# File 'lib/stackprofiler/filters/frame_regex_removal.rb', line 10 def regexes ary = @options[:regexes] || [] @regexes ||= ary.reject(&:blank?).map {|r| /#{r}/ }.compact end |