lib/contrast/agent/patching/policy/patcher.rb in contrast-agent-4.4.1 vs lib/contrast/agent/patching/policy/patcher.rb in contrast-agent-4.5.0

- old
+ new

@@ -1,6 +1,6 @@ -# Copyright (c) 2020 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details. +# Copyright (c) 2021 Contrast Security, Inc. See https://www.contrastsecurity.com/enduser-terms-0317a for more details. # frozen_string_literal: true require 'monitor' # base @@ -258,18 +258,16 @@ end # We've found the patchers that apply to this class (or module). Now we'll # filter on the given method. # - # @param mod [Module] The module from which to retrieve instance - # methods. - # @param methods [Array<Symbol>] The names of all the methods in - # in this module - # @param module_policy [Contrast::Agent::Patching::Policy::ModulePolicy] - # All the patchers that apply to this class, sorted by type. - # @param is_instance_method [Boolean] Indicates if these methods - # are the instance or singleton methods for this module. - # @return [Integer] number of methods patched + # @param mod [Module] The module from which to retrieve instance methods. + # @param methods [Array<Symbol>] The names of all the methods in in this module + # @param module_policy [Contrast::Agent::Patching::Policy::ModulePolicy] All the patchers that apply to + # this class, sorted by type. + # @param is_instance_method [Boolean] Indicates if these methods are the instance or singleton methods for + # this module. + # @return [Integer] number of methods patched. def patch_into_methods mod, methods, module_policy, is_instance_method count = 0 methods.each do |method| method_policy = Contrast::Agent::Patching::Policy::MethodPolicy.build_method_policy(method, module_policy, is_instance_method) next if method_policy.empty?