class ChaosDetector::Stacker::FnInfo

Public Class Methods

line_match?(l1, l2) click to toggle source
# File lib/chaos_detector/stacker/fn_info.rb, line 36
def line_match?(l1, l2)
  return false if l1.nil? || l2.nil?

  (l2 - l1).between?(0, 1)
end
match?(obj1, obj2, line_matching: false) click to toggle source
# File lib/chaos_detector/stacker/fn_info.rb, line 31
def match?(obj1, obj2, line_matching: false)
  obj1.fn_path == obj2.fn_path && obj1.fn_name == obj2.fn_name
  # (obj1.fn_name == obj2.fn_name || line_match?(obj1.fn_line, obj2.fn_line))
end
new(fn_name:, fn_line: nil, fn_path: nil) click to toggle source
Calls superclass method ChaosDetector::Stacker::CompInfo::new
# File lib/chaos_detector/stacker/fn_info.rb, line 10
def initialize(fn_name:, fn_line: nil, fn_path: nil)
  super(name: fn_name, path: fn_path, info: fn_line)
end

Public Instance Methods

==(other) click to toggle source
# File lib/chaos_detector/stacker/fn_info.rb, line 14
def ==(other)
  ChaosDetector::Stacker::FnInfo.match?(self, other)
end
component_type() click to toggle source
# File lib/chaos_detector/stacker/fn_info.rb, line 26
def component_type
  :function
end
fn_info() click to toggle source
# File lib/chaos_detector/stacker/fn_info.rb, line 18
def fn_info
  self
end
to_s() click to toggle source
# File lib/chaos_detector/stacker/fn_info.rb, line 22
def to_s
  "##{fn_name}: #{fn_path}:L#{fn_line}"
end