Skip to content

Commit

Permalink
Merge pull request #190 from Shopify/amomchilov-patch-1
Browse files Browse the repository at this point in the history
`starts_with?` and `ends_with?`
  • Loading branch information
vinistock authored Dec 18, 2023
2 parents c141a6c + 5808095 commit 7568f7d
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); end

# @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); end

# @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 7568f7d

Please sign in to comment.