DEV: More `send` -> `public_send`.

DEV: More send -> public_send.

diff --git a/app/jobs/regular/export_csv_file.rb b/app/jobs/regular/export_csv_file.rb
index f5e29ef..76aa5db 100644
--- a/app/jobs/regular/export_csv_file.rb
+++ b/app/jobs/regular/export_csv_file.rb
@@ -54,7 +54,7 @@ module Jobs
       # write to CSV file
       CSV.open(absolute_path, "w") do |csv|
         csv << get_header
-        send(export_method).each { |d| csv << d }
+        public_send(export_method).each { |d| csv << d }
       end
 
       # compress CSV file
diff --git a/lib/plugin/instance.rb b/lib/plugin/instance.rb
index 8753ce6..eb66e91 100644
--- a/lib/plugin/instance.rb
+++ b/lib/plugin/instance.rb
@@ -524,7 +524,7 @@ class Plugin::Instance
       provider = Auth::AuthProvider.new
 
       Auth::AuthProvider.auth_attributes.each do |sym|
-        provider.send "#{sym}=", opts.delete(sym) if opts.has_key?(sym)
+        provider.public_send("#{sym}=", opts.delete(sym)) if opts.has_key?(sym)
       end
 
       begin
diff --git a/lib/search/grouped_search_results.rb b/lib/search/grouped_search_results.rb
index ffe5dca..1f32eaa 100644
--- a/lib/search/grouped_search_results.rb
+++ b/lib/search/grouped_search_results.rb
@@ -60,7 +60,7 @@ class Search
       elsif !@type_filter.present? && send(type).length == Search.per_facet
         instance_variable_set("@more_#{type}".to_sym, true)
       else
-        (send type) << object
+        (self.public_send(type)) << object
       end
     end
 
diff --git a/lib/single_sign_on.rb b/lib/single_sign_on.rb
index 8320c2e..fd5b83e 100644
--- a/lib/single_sign_on.rb
+++ b/lib/single_sign_on.rb
@@ -128,8 +128,8 @@ class SingleSignOn
     payload = {}
 
     ACCESSORS.each do |k|
-      next if (val = send k) == nil
-     payload[k] = val
+      next if (val = public_send(k)) == nil
+      payload[k] = val
     end
 
     @custom_fields&.each do |k, v|
diff --git a/lib/stylesheet/functions.rb b/lib/stylesheet/functions.rb
index 49c2eae..2e8a900 100644
--- a/lib/stylesheet/functions.rb
+++ b/lib/stylesheet/functions.rb
@@ -9,4 +9,4 @@ module Stylesheet
   end
 end
 
-::SassC::Script::Functions.send :include, Stylesheet::ScssFunctions
+::SassC::Script::Functions.public_send(:include, Stylesheet::ScssFunctions)

GitHub sha: 451f7842

:thinking:

::SassC::Script::Functions.include(Stylesheet::ScssFunctions)

Which makes me wonder why we were doing a send in the first place?

1 Like

O I thought about that too but I didn’t want any surprises in my commit.

[4] pry(main)> module Bob; end
=> nil
[5] pry(main)> SassC::Script::Functions.include(Bob)
=> SassC::Script::Functions

Seems to work to me … I will give it a shot, simpler code is always easier to maintain.

1 Like