mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 06:41:25 +08:00
DEV: Prefer public_send
over send
.
This commit is contained in:
@ -48,7 +48,7 @@ class Mapping
|
||||
def initialize(lines)
|
||||
|
||||
FIELDS.each do |field|
|
||||
self.send("#{field}=", 0)
|
||||
self.public_send("#{field}=", 0)
|
||||
end
|
||||
|
||||
parse_first_line(lines.shift)
|
||||
@ -72,7 +72,7 @@ class Mapping
|
||||
field = parts[0].downcase.sub(':', '')
|
||||
if respond_to? "#{field}="
|
||||
value = Float(parts[1]).to_i
|
||||
self.send("#{field}=", value)
|
||||
self.public_send("#{field}=", value)
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -81,7 +81,7 @@ def consume_mapping(map_lines, totals)
|
||||
m = Mapping.new(map_lines)
|
||||
|
||||
Mapping::FIELDS.each do |field|
|
||||
totals[field] += m.send(field)
|
||||
totals[field] += m.public_send(field)
|
||||
end
|
||||
return m
|
||||
end
|
||||
|
Reference in New Issue
Block a user