Skip to content

Commit

Permalink
starts_with? and ends_with?
Browse files Browse the repository at this point in the history
  • Loading branch information
amomchilov committed Dec 16, 2023
1 parent c141a6c commit 31a14f1
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions rbi/annotations/activesupport.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 31a14f1

Please sign in to comment.