Skip to content

Commit

Permalink
Merge pull request Shopify#265 from olivier-thatch/olivier/rails-7-2-…
Browse files Browse the repository at this point in the history
…present

Add more signatures for `#present?` for Rails 7.2
  • Loading branch information
KaanOzkan authored Jul 18, 2024
2 parents 43b102b + 1a1e940 commit 4b124da
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions rbi/annotations/activesupport.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,23 @@ class Object
end

class Hash
sig { returns(T::Boolean)}
def blank?; end

sig { returns(T::Boolean)}
def present?; end

sig { returns(T::Boolean) }
def extractable_options?; end
end

class Array
sig { returns(T::Boolean)}
def blank?; end

sig { returns(T::Boolean)}
def present?; end

sig { params(position: Integer).returns(T.self_type) }
def from(position); end

Expand Down Expand Up @@ -273,6 +285,12 @@ class Time
end

class Symbol
sig { returns(T::Boolean)}
def blank?; end

sig { returns(T::Boolean)}
def present?; end

# alias for `#start_with?`
sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) }
def starts_with?(*string_or_regexp); end
Expand Down Expand Up @@ -372,6 +390,9 @@ class String
sig { params(count: T.nilable(T.any(Integer, Symbol)), locale: T.nilable(Symbol)).returns(String) }
def pluralize(count = nil, locale = :en); end

sig { returns(T::Boolean)}
def present?; end

sig { params(patterns: T.any(String, Regexp)).returns(String) }
def remove(*patterns); end

Expand Down

0 comments on commit 4b124da

Please sign in to comment.