DEV: Prefer public_send over send.

This commit is contained in:
Guo Xiang Tan
2019-05-07 09:27:05 +08:00
parent 9be70a22cd
commit 152238b4cf
74 changed files with 216 additions and 129 deletions

View File

@ -107,8 +107,9 @@ module Email
styled = Email::Styles.new(html_override, @opts)
styled.format_basic
if style = @opts[:style]
styled.send("format_#{style}")
styled.public_send("format_#{style}")
end
Mail::Part.new do

View File

@ -345,7 +345,7 @@ module Email
# use the first html extracter that matches
if html_extracter = HTML_EXTRACTERS.select { |_, r| html[r] }.min_by { |_, r| html =~ r }
doc = Nokogiri::HTML.fragment(html)
self.send(:"extract_from_#{html_extracter[0]}", doc)
self.public_send(:"extract_from_#{html_extracter[0]}", doc)
else
markdown = HtmlToMarkdown.new(html, keep_img_tags: true, keep_cid_imgs: true).to_markdown
markdown = trim_discourse_markers(markdown)
@ -1176,7 +1176,7 @@ module Email
end
def send_subscription_mail(action, user)
message = SubscriptionMailer.send(action, user)
message = SubscriptionMailer.public_send(action, user)
Email::Sender.new(message, :subscription).send
end