Skip to content

Commit

Permalink
Drop support for Rubies below 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
saturnflyer committed Dec 20, 2024
1 parent 5f9b581 commit d6de464
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions lib/radius/utility.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,11 @@ def self.camelize(underscored_string)
string
end

if RUBY_VERSION[0,3] >= '2.3'
def self.array_to_s(c)
c.map do |x|
res = (x.is_a?(Array) ? array_to_s(x) : x.to_s)
+res
end.join
end
else
def self.array_to_s(c)
c.map do |x|
res = (x.is_a?(Array) ? array_to_s(x) : x.to_s)
(res.frozen? ? res.dup : res).force_encoding(Encoding::UTF_8)
end.join
end
def self.array_to_s(c)
c.map do |x|
res = (x.is_a?(Array) ? array_to_s(x) : x.to_s)
+res
end.join
end
end
end

0 comments on commit d6de464

Please sign in to comment.