From 31a14f10614f68893588876b44af0429466d6e8f Mon Sep 17 00:00:00 2001 From: Alexander Momchilov Date: Fri, 15 Dec 2023 20:18:48 -0500 Subject: [PATCH] `starts_with?` and `ends_with?` --- rbi/annotations/activesupport.rbi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/rbi/annotations/activesupport.rbi b/rbi/annotations/activesupport.rbi index a422b3c7..617f13c5 100644 --- a/rbi/annotations/activesupport.rbi +++ b/rbi/annotations/activesupport.rbi @@ -259,3 +259,23 @@ class Time sig { returns(TrueClass) } def present?; end end + +class Symbol + # @shim: alias for `#start_with?` + sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) } + def starts_with?(*string_or_regexp) + + # @shim: alias for `#end_with?` + sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) } + def ends_with?(*string_or_regexp); end +end + +class String + # @shim: alias for `#start_with?` + sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) } + def starts_with?(*string_or_regexp) + + # @shim: alias for `#end_with?` + sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) } + def ends_with?(*string_or_regexp); end +end