rails-on-sorbet 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rails/on/sorbet/version.rb +1 -1
- data/rbi/action_controller.rbi +10 -0
- data/rbi/current_attributes.rbi +17 -0
- data/rbi/datetime.rbi +11 -0
- data/rbi/duration.rbi +327 -0
- data/rbi/map.rbi +933 -0
- data/rbi/numeric.rbi +254 -0
- metadata +7 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f5e0d7b6853626db379b968ec909cf4670b3a381012d58af23a93bb4469f4066
|
|
4
|
+
data.tar.gz: 51a4b3e99bad8beb18e32a27600c2eb5b65555bab167a65fcea0f417b4455016
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7f8bfede01450bb8de799aa188b2ca25702c94db5608ef2f2143a23bffd1885dc69bd3d732859118403bbfdc3d396ff4853c2509710ea48d640c3395d45dc544
|
|
7
|
+
data.tar.gz: c160ef4c3709bb94b0cd596747a51e05f814d047324ebbcb9f55932013eafb5beab9b91d334363bd31e47a54ede872e751bfe340ad5b23483594e87bb5373ab5
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
|
|
3
|
+
class ActiveSupport::CurrentAttributes
|
|
4
|
+
# Declares one or more attributes that will be given both class and instance accessor methods.
|
|
5
|
+
#
|
|
6
|
+
# ==== Options
|
|
7
|
+
#
|
|
8
|
+
# * <tt>:default</tt> - The default value for the attributes. If the value
|
|
9
|
+
# is a proc or lambda, it will be called whenever an instance is
|
|
10
|
+
# constructed. Otherwise, the value will be duplicated with +#dup+.
|
|
11
|
+
# Default values are re-assigned when the attributes are reset.
|
|
12
|
+
#
|
|
13
|
+
# source://activesupport//lib/active_support/current_attributes.rb#114
|
|
14
|
+
#
|
|
15
|
+
#: (*Symbol, ?type: untyped, ?doc: String?, ?default: untyped) -> void
|
|
16
|
+
def attribute(*names, type: nil, doc: nil, default: ::ActiveSupport::CurrentAttributes::NOT_SET); end
|
|
17
|
+
end
|
data/rbi/datetime.rbi
ADDED
data/rbi/duration.rbi
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
# typed: true
|
|
2
|
+
|
|
3
|
+
# = Active Support \Duration
|
|
4
|
+
#
|
|
5
|
+
# Provides accurate date and time measurements using Date#advance and
|
|
6
|
+
# Time#advance, respectively. It mainly supports the methods on Numeric.
|
|
7
|
+
#
|
|
8
|
+
# 1.month.ago # equivalent to Time.now.advance(months: -1)
|
|
9
|
+
#
|
|
10
|
+
# source://activesupport//lib/active_support/duration.rb#14
|
|
11
|
+
class ActiveSupport::Duration
|
|
12
|
+
# @return [Duration] a new instance of Duration
|
|
13
|
+
#
|
|
14
|
+
# source://activesupport//lib/active_support/duration.rb#224
|
|
15
|
+
def initialize(value, parts, variable = T.unsafe(nil)); end
|
|
16
|
+
|
|
17
|
+
# Returns the modulo of this Duration by another Duration or Numeric.
|
|
18
|
+
# Numeric values are treated as seconds.
|
|
19
|
+
#
|
|
20
|
+
# source://activesupport//lib/active_support/duration.rb#307
|
|
21
|
+
#: (ActiveSupport::Duration | Numeric) -> ActiveSupport::Duration
|
|
22
|
+
def %(other); end
|
|
23
|
+
|
|
24
|
+
# Multiplies this Duration by a Numeric and returns a new Duration.
|
|
25
|
+
#
|
|
26
|
+
# source://activesupport//lib/active_support/duration.rb#282
|
|
27
|
+
#: (ActiveSupport::Duration | Numeric) -> ActiveSupport::Duration
|
|
28
|
+
def *(other); end
|
|
29
|
+
|
|
30
|
+
# Adds another Duration or a Numeric to this Duration. Numeric values
|
|
31
|
+
# are treated as seconds.
|
|
32
|
+
#
|
|
33
|
+
# source://activesupport//lib/active_support/duration.rb#263
|
|
34
|
+
#: (ActiveSupport::Duration | Numeric) -> ActiveSupport::Duration
|
|
35
|
+
def +(other); end
|
|
36
|
+
|
|
37
|
+
# source://activesupport//lib/active_support/duration.rb#321
|
|
38
|
+
#: -> self
|
|
39
|
+
def +@; end
|
|
40
|
+
|
|
41
|
+
# Subtracts another Duration or a Numeric from this Duration. Numeric
|
|
42
|
+
# values are treated as seconds.
|
|
43
|
+
#
|
|
44
|
+
# source://activesupport//lib/active_support/duration.rb#277
|
|
45
|
+
#: (ActiveSupport::Duration | Numeric) -> ActiveSupport::Duration
|
|
46
|
+
def -(other); end
|
|
47
|
+
|
|
48
|
+
# source://activesupport//lib/active_support/duration.rb#317
|
|
49
|
+
#: -> self
|
|
50
|
+
def -@; end
|
|
51
|
+
|
|
52
|
+
# Divides this Duration by a Numeric and returns a new Duration.
|
|
53
|
+
#
|
|
54
|
+
# source://activesupport//lib/active_support/duration.rb#293
|
|
55
|
+
#: (ActiveSupport::Duration | Numeric) -> ActiveSupport::Duration
|
|
56
|
+
def /(other); end
|
|
57
|
+
|
|
58
|
+
# Compares one Duration with another or a Numeric to this Duration.
|
|
59
|
+
# Numeric values are treated as seconds.
|
|
60
|
+
#
|
|
61
|
+
# source://activesupport//lib/active_support/duration.rb#253
|
|
62
|
+
#: (ActiveSupport::Duration | Numeric) -> Integer
|
|
63
|
+
def <=>(other); end
|
|
64
|
+
|
|
65
|
+
#: (ActiveSupport::Duration | Numeric) -> bool
|
|
66
|
+
def <(other); end
|
|
67
|
+
#: (ActiveSupport::Duration | Numeric) -> bool
|
|
68
|
+
def <=(other); end
|
|
69
|
+
#: (ActiveSupport::Duration | Numeric) -> bool
|
|
70
|
+
def >(other); end
|
|
71
|
+
#: (ActiveSupport::Duration | Numeric) -> bool
|
|
72
|
+
def >=(other); end
|
|
73
|
+
|
|
74
|
+
# Returns +true+ if +other+ is also a Duration instance with the
|
|
75
|
+
# same +value+, or if <tt>other == value</tt>.
|
|
76
|
+
#
|
|
77
|
+
# source://activesupport//lib/active_support/duration.rb#336
|
|
78
|
+
#: (top other) -> bool
|
|
79
|
+
def ==(other); end
|
|
80
|
+
|
|
81
|
+
# source://activesupport//lib/active_support/duration.rb#476
|
|
82
|
+
def _parts; end
|
|
83
|
+
|
|
84
|
+
# Calculates a new Time or Date that is as far in the future
|
|
85
|
+
# as this Duration represents.
|
|
86
|
+
#
|
|
87
|
+
# source://activesupport//lib/active_support/duration.rb#431
|
|
88
|
+
#
|
|
89
|
+
#: [D] (?D & Timelike) -> (D & Timelike)
|
|
90
|
+
#: -> ActiveSupport::TimeWithZone
|
|
91
|
+
def after(time = T.unsafe(nil)); end
|
|
92
|
+
|
|
93
|
+
# Calculates a new Time or Date that is as far in the past
|
|
94
|
+
# as this Duration represents.
|
|
95
|
+
#
|
|
96
|
+
# source://activesupport//lib/active_support/duration.rb#439
|
|
97
|
+
#
|
|
98
|
+
#: [D] (?D & Timelike) -> (D & Timelike)
|
|
99
|
+
#: -> ActiveSupport::TimeWithZone
|
|
100
|
+
def ago(time = T.unsafe(nil)); end
|
|
101
|
+
|
|
102
|
+
# source://activesupport//lib/active_support/duration.rb#454
|
|
103
|
+
#: (?T::Hash[Symbol, top]?) -> Integer
|
|
104
|
+
def as_json(options = T.unsafe(nil)); end
|
|
105
|
+
|
|
106
|
+
# Calculates a new Time or Date that is as far in the past
|
|
107
|
+
# as this Duration represents.
|
|
108
|
+
#
|
|
109
|
+
# source://activesupport//lib/active_support/duration.rb#439
|
|
110
|
+
#
|
|
111
|
+
#: [D] (?D & Timelike) -> (D & Timelike)
|
|
112
|
+
#: -> ActiveSupport::TimeWithZone
|
|
113
|
+
def before(time = T.unsafe(nil)); end
|
|
114
|
+
|
|
115
|
+
# source://activesupport//lib/active_support/duration.rb#240
|
|
116
|
+
def coerce(other); end
|
|
117
|
+
|
|
118
|
+
# source://activesupport//lib/active_support/duration.rb#462
|
|
119
|
+
def encode_with(coder); end
|
|
120
|
+
|
|
121
|
+
# Returns +true+ if +other+ is also a Duration instance, which has the
|
|
122
|
+
# same parts as this one.
|
|
123
|
+
#
|
|
124
|
+
# @return [Boolean]
|
|
125
|
+
#
|
|
126
|
+
# source://activesupport//lib/active_support/duration.rb#421
|
|
127
|
+
#
|
|
128
|
+
#: (top) -> bool
|
|
129
|
+
def eql?(other); end
|
|
130
|
+
|
|
131
|
+
# Calculates a new Time or Date that is as far in the future
|
|
132
|
+
# as this Duration represents.
|
|
133
|
+
#
|
|
134
|
+
# source://activesupport//lib/active_support/duration.rb#431
|
|
135
|
+
#
|
|
136
|
+
#: [D] (?D & Timelike) -> (D & Timelike)
|
|
137
|
+
#: -> ActiveSupport::TimeWithZone
|
|
138
|
+
def from_now(time = T.unsafe(nil)); end
|
|
139
|
+
|
|
140
|
+
# source://activesupport//lib/active_support/duration.rb#425
|
|
141
|
+
#
|
|
142
|
+
#: -> Integer
|
|
143
|
+
def hash; end
|
|
144
|
+
|
|
145
|
+
# Returns the amount of days a duration covers as a float
|
|
146
|
+
#
|
|
147
|
+
# 12.hours.in_days # => 0.5
|
|
148
|
+
#
|
|
149
|
+
# source://activesupport//lib/active_support/duration.rb#394
|
|
150
|
+
#
|
|
151
|
+
#: -> Float
|
|
152
|
+
def in_days; end
|
|
153
|
+
|
|
154
|
+
# Returns the amount of hours a duration covers as a float
|
|
155
|
+
#
|
|
156
|
+
# 1.day.in_hours # => 24.0
|
|
157
|
+
#
|
|
158
|
+
# source://activesupport//lib/active_support/duration.rb#387
|
|
159
|
+
#
|
|
160
|
+
#: -> Float
|
|
161
|
+
def in_hours; end
|
|
162
|
+
|
|
163
|
+
# Returns the amount of minutes a duration covers as a float
|
|
164
|
+
#
|
|
165
|
+
# 1.day.in_minutes # => 1440.0
|
|
166
|
+
#
|
|
167
|
+
# source://activesupport//lib/active_support/duration.rb#380
|
|
168
|
+
def in_minutes; end
|
|
169
|
+
|
|
170
|
+
# Returns the amount of months a duration covers as a float
|
|
171
|
+
#
|
|
172
|
+
# 9.weeks.in_months # => 2.07
|
|
173
|
+
#
|
|
174
|
+
# source://activesupport//lib/active_support/duration.rb#408
|
|
175
|
+
#
|
|
176
|
+
#: -> Float
|
|
177
|
+
def in_months; end
|
|
178
|
+
|
|
179
|
+
# Returns the number of seconds that this Duration represents.
|
|
180
|
+
#
|
|
181
|
+
# 1.minute.to_i # => 60
|
|
182
|
+
# 1.hour.to_i # => 3600
|
|
183
|
+
# 1.day.to_i # => 86400
|
|
184
|
+
#
|
|
185
|
+
# Note that this conversion makes some assumptions about the
|
|
186
|
+
# duration of some periods, e.g. months are always 1/12 of year
|
|
187
|
+
# and years are 365.2425 days:
|
|
188
|
+
#
|
|
189
|
+
# # equivalent to (1.year / 12).to_i
|
|
190
|
+
# 1.month.to_i # => 2629746
|
|
191
|
+
#
|
|
192
|
+
# # equivalent to 365.2425.days.to_i
|
|
193
|
+
# 1.year.to_i # => 31556952
|
|
194
|
+
#
|
|
195
|
+
# In such cases, Ruby's core
|
|
196
|
+
# Date[https://ruby-doc.org/stdlib/libdoc/date/rdoc/Date.html] and
|
|
197
|
+
# Time[https://ruby-doc.org/stdlib/libdoc/time/rdoc/Time.html] should be used for precision
|
|
198
|
+
# date and time arithmetic.
|
|
199
|
+
#
|
|
200
|
+
# source://activesupport//lib/active_support/duration.rb#372
|
|
201
|
+
#
|
|
202
|
+
#: -> Integer
|
|
203
|
+
def in_seconds; end
|
|
204
|
+
|
|
205
|
+
# Returns the amount of weeks a duration covers as a float
|
|
206
|
+
#
|
|
207
|
+
# 2.months.in_weeks # => 8.696
|
|
208
|
+
#
|
|
209
|
+
# source://activesupport//lib/active_support/duration.rb#401
|
|
210
|
+
#
|
|
211
|
+
#: -> Float
|
|
212
|
+
def in_weeks; end
|
|
213
|
+
|
|
214
|
+
# Returns the amount of years a duration covers as a float
|
|
215
|
+
#
|
|
216
|
+
# 30.days.in_years # => 0.082
|
|
217
|
+
#
|
|
218
|
+
# source://activesupport//lib/active_support/duration.rb#415
|
|
219
|
+
#
|
|
220
|
+
#: -> Float
|
|
221
|
+
def in_years; end
|
|
222
|
+
|
|
223
|
+
# source://activesupport//lib/active_support/duration.rb#458
|
|
224
|
+
def init_with(coder); end
|
|
225
|
+
|
|
226
|
+
# source://activesupport//lib/active_support/duration.rb#445
|
|
227
|
+
#
|
|
228
|
+
#: -> String
|
|
229
|
+
def inspect; end
|
|
230
|
+
|
|
231
|
+
# @return [Boolean]
|
|
232
|
+
#
|
|
233
|
+
# source://activesupport//lib/active_support/duration.rb#330
|
|
234
|
+
#
|
|
235
|
+
#: (Module) -> bool
|
|
236
|
+
def instance_of?(klass); end
|
|
237
|
+
|
|
238
|
+
# @return [Boolean]
|
|
239
|
+
#
|
|
240
|
+
# source://activesupport//lib/active_support/duration.rb#325
|
|
241
|
+
#
|
|
242
|
+
#: (Module) -> bool
|
|
243
|
+
def is_a?(klass); end
|
|
244
|
+
|
|
245
|
+
# Build ISO 8601 Duration string for this duration.
|
|
246
|
+
# The +precision+ parameter can be used to limit seconds' precision of duration.
|
|
247
|
+
#
|
|
248
|
+
# source://activesupport//lib/active_support/duration.rb#468
|
|
249
|
+
#
|
|
250
|
+
#: (?precision: top) -> String
|
|
251
|
+
def iso8601(precision: T.unsafe(nil)); end
|
|
252
|
+
|
|
253
|
+
# @return [Boolean]
|
|
254
|
+
#
|
|
255
|
+
# source://activesupport//lib/active_support/duration.rb#325
|
|
256
|
+
#
|
|
257
|
+
#: (Module) -> bool
|
|
258
|
+
def kind_of?(klass); end
|
|
259
|
+
|
|
260
|
+
# Returns a copy of the parts hash that defines the duration
|
|
261
|
+
#
|
|
262
|
+
# source://activesupport//lib/active_support/duration.rb#236
|
|
263
|
+
#
|
|
264
|
+
#: -> Hash[Symbol, Numeric]
|
|
265
|
+
def parts; end
|
|
266
|
+
|
|
267
|
+
# Calculates a new Time or Date that is as far in the future
|
|
268
|
+
# as this Duration represents.
|
|
269
|
+
#
|
|
270
|
+
# source://activesupport//lib/active_support/duration.rb#431
|
|
271
|
+
#
|
|
272
|
+
#: [D] (?D & Timelike) -> (D & Timelike)
|
|
273
|
+
#: -> ActiveSupport::TimeWithZone
|
|
274
|
+
def since(time = T.unsafe(nil)); end
|
|
275
|
+
|
|
276
|
+
# Returns the number of seconds that this Duration represents.
|
|
277
|
+
#
|
|
278
|
+
# 1.minute.to_i # => 60
|
|
279
|
+
# 1.hour.to_i # => 3600
|
|
280
|
+
# 1.day.to_i # => 86400
|
|
281
|
+
#
|
|
282
|
+
# Note that this conversion makes some assumptions about the
|
|
283
|
+
# duration of some periods, e.g. months are always 1/12 of year
|
|
284
|
+
# and years are 365.2425 days:
|
|
285
|
+
#
|
|
286
|
+
# # equivalent to (1.year / 12).to_i
|
|
287
|
+
# 1.month.to_i # => 2629746
|
|
288
|
+
#
|
|
289
|
+
# # equivalent to 365.2425.days.to_i
|
|
290
|
+
# 1.year.to_i # => 31556952
|
|
291
|
+
#
|
|
292
|
+
# In such cases, Ruby's core
|
|
293
|
+
# Date[https://ruby-doc.org/stdlib/libdoc/date/rdoc/Date.html] and
|
|
294
|
+
# Time[https://ruby-doc.org/stdlib/libdoc/time/rdoc/Time.html] should be used for precision
|
|
295
|
+
# date and time arithmetic.
|
|
296
|
+
#
|
|
297
|
+
# source://activesupport//lib/active_support/duration.rb#372
|
|
298
|
+
#
|
|
299
|
+
#: -> Integer
|
|
300
|
+
def to_i; end
|
|
301
|
+
|
|
302
|
+
# Returns the amount of seconds a duration covers as a string.
|
|
303
|
+
# For more information check to_i method.
|
|
304
|
+
#
|
|
305
|
+
# 1.day.to_s # => "86400"
|
|
306
|
+
#
|
|
307
|
+
# source://activesupport//lib/active_support/duration.rb#348
|
|
308
|
+
#
|
|
309
|
+
#: -> String
|
|
310
|
+
def to_s; end
|
|
311
|
+
|
|
312
|
+
# Calculates a new Time or Date that is as far in the past
|
|
313
|
+
# as this Duration represents.
|
|
314
|
+
#
|
|
315
|
+
# source://activesupport//lib/active_support/duration.rb#439
|
|
316
|
+
#
|
|
317
|
+
#: [D] (?D & Timelike) -> (D & Timelike)
|
|
318
|
+
#: -> ActiveSupport::TimeWithZone
|
|
319
|
+
def until(time = T.unsafe(nil)); end
|
|
320
|
+
|
|
321
|
+
# Returns the value of attribute value.
|
|
322
|
+
#
|
|
323
|
+
# source://activesupport//lib/active_support/duration.rb#133
|
|
324
|
+
#
|
|
325
|
+
#: -> Numeric
|
|
326
|
+
def value; end
|
|
327
|
+
end
|