Skip to content

Commit

Permalink
Add duration methods to Integer
Browse files Browse the repository at this point in the history
  • Loading branch information
grncdr authored May 29, 2023
1 parent 0eae2eb commit f236122
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions rbi/annotations/activesupport.rbi
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,37 @@ class Hash
def extractable_options?; end
end

class Integer
sig { returns(ActiveSupport::Duration) }
def seconds; end
sig { returns(ActiveSupport::Duration) }
def second; end
sig { returns(ActiveSupport::Duration) }
def minutes; end
sig { returns(ActiveSupport::Duration) }
def minute; end
sig { returns(ActiveSupport::Duration) }
def hours; end
sig { returns(ActiveSupport::Duration) }
def hour; end
sig { returns(ActiveSupport::Duration) }
def days; end
sig { returns(ActiveSupport::Duration) }
def day; end
sig { returns(ActiveSupport::Duration) }
def weeks; end
sig { returns(ActiveSupport::Duration) }
def week; end
sig { returns(ActiveSupport::Duration) }
def months; end
sig { returns(ActiveSupport::Duration) }
def month; end
sig { returns(ActiveSupport::Duration) }
def years; end
sig { returns(ActiveSupport::Duration) }
def year; end
end

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

0 comments on commit f236122

Please sign in to comment.