class PrivatePlease::Tracking::Result

Public Class Methods

new(encountered_method_calls) click to toggle source
# File lib/private_please/tracking/result.rb, line 6
def initialize(encountered_method_calls)
  @private_calls = encountered_method_calls.private_calls
  @public_calls = encountered_method_calls.public_calls
end

Public Instance Methods

public_methods_only_called_privately() click to toggle source
# File lib/private_please/tracking/result.rb, line 11
def public_methods_only_called_privately
  @private_calls - @public_calls
end
to_two_level_hash() click to toggle source
# File lib/private_please/tracking/result.rb, line 15
def to_two_level_hash
  two_level_hash = Hash.new { |h, k| h[k] = {} }
  public_methods_only_called_privately.each do |class_plus_method|
    md = MethodDetails.from_class_plus_method(class_plus_method)
    two_level_hash[md.klass][md.separator_plus_method] = [md.source_path, md.lineno]
  end
  two_level_hash.delete_if { |_k, v| v.empty? }
end