Ruby 3.0 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Symbolクラス > end_with?
end_with?(*suffixes) -> bool
[permalink][rdoc]self の末尾が suffixes のいずれかであるとき true を返します。
(self.to_s.end_with?と同じです。)
[SEE_ALSO] Symbol#start_with?
[SEE_ALSO] String#end_with?
:hello.end_with?("ello") #=> true
# returns true if one of the +suffixes+ matches.
:hello.end_with?("heaven", "ello") #=> true
:hello.end_with?("heaven", "paradise") #=> false