71
71
# * Other non-numeric: raises TypeError.
72
72
#
73
73
class Date
74
+ type date_record = { mday: Integer, mon: Integer, year: Integer }
75
+
76
+ type datetime_with_timezone_record = { ?wday: Integer, ?mday: Integer, ?mon: Integer, ?year: Integer, ?hour: Integer, ?min: Integer, ?sec: Integer, ?zone: String, ?offset: Integer}
77
+
74
78
# <!--
75
79
# rdoc-file=ext/date/date_core.c
76
80
# - Date.new(year = -4712, month = 1, mday = 1, start = Date::ITALY) -> date
@@ -112,7 +116,7 @@ class Date
112
116
#
113
117
# Related: Date.httpdate (returns a Date object).
114
118
#
115
- def self._httpdate : (String str) -> Hash[Symbol, Integer]
119
+ def self._httpdate : (String str, ?limit: Integer ) -> datetime_with_timezone_record
116
120
117
121
# <!--
118
122
# rdoc-file=ext/date/date_core.c
@@ -130,7 +134,7 @@ class Date
130
134
#
131
135
# Related: Date.iso8601 (returns a Date object).
132
136
#
133
- def self._iso8601 : (String str) -> Hash[Symbol, Integer]
137
+ def self._iso8601 : (String str, ?limit: Integer ) -> date_record
134
138
135
139
# <!--
136
140
# rdoc-file=ext/date/date_core.c
@@ -147,7 +151,7 @@ class Date
147
151
#
148
152
# Related: Date.jisx0301 (returns a Date object).
149
153
#
150
- def self._jisx0301 : (String str) -> Hash[Symbol, Integer]
154
+ def self._jisx0301 : (String str, ?limit: Integer ) -> date_record
151
155
152
156
# <!--
153
157
# rdoc-file=ext/date/date_core.c
@@ -192,7 +196,7 @@ class Date
192
196
#
193
197
# Related: Date.rfc2822 (returns a Date object).
194
198
#
195
- def self._rfc2822 : (String str) -> Hash[Symbol, Integer | String]
199
+ def self._rfc2822 : (String str, ?limit: Integer ) -> datetime_with_timezone_record
196
200
197
201
# <!--
198
202
# rdoc-file=ext/date/date_core.c
@@ -210,7 +214,7 @@ class Date
210
214
#
211
215
# Related: Date.rfc3339 (returns a Date object).
212
216
#
213
- def self._rfc3339 : (String str) -> Hash[Symbol, Integer | String]
217
+ def self._rfc3339 : (String str, ?limit: Integer ) -> datetime_with_timezone_record
214
218
215
219
# <!--
216
220
# rdoc-file=ext/date/date_core.c
@@ -228,7 +232,7 @@ class Date
228
232
#
229
233
# Related: Date.rfc2822 (returns a Date object).
230
234
#
231
- def self._rfc822 : (String str) -> Hash[Symbol, Integer | String]
235
+ def self._rfc822 : (String str, ?limit: Integer ) -> datetime_with_timezone_record
232
236
233
237
# <!--
234
238
# rdoc-file=ext/date/date_core.c
0 commit comments