String#has_suffix?(): allow nested arrays of suffixes

This commit is contained in:
josh committed 2013-08-05 14:51:07 -04:00
1 parent 13b9499fbf
commit c3c6385068
1 file changed
+1
+1
View File
@@ -6,6 +6,7 @@ class String
def has_suffix?(suffix)
if suffix
suffix = [suffix] if suffix.is_a?(String)
suffix = suffix.flatten
suffix.find {|s| self.end_with?(s)}
end
end