7171# * Other non-numeric: raises TypeError.
7272#
7373class 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+
7478 # <!--
7579 # rdoc-file=ext/date/date_core.c
7680 # - Date.new(year = -4712, month = 1, mday = 1, start = Date::ITALY) -> date
@@ -112,7 +116,7 @@ class Date
112116 #
113117 # Related: Date.httpdate (returns a Date object).
114118 #
115- def self._httpdate : (String str) -> Hash[Symbol, Integer]
119+ def self._httpdate : (String str, ?limit: Integer ) -> datetime_with_timezone_record
116120
117121 # <!--
118122 # rdoc-file=ext/date/date_core.c
@@ -130,7 +134,7 @@ class Date
130134 #
131135 # Related: Date.iso8601 (returns a Date object).
132136 #
133- def self._iso8601 : (String str) -> Hash[Symbol, Integer]
137+ def self._iso8601 : (String str, ?limit: Integer ) -> date_record
134138
135139 # <!--
136140 # rdoc-file=ext/date/date_core.c
@@ -147,7 +151,7 @@ class Date
147151 #
148152 # Related: Date.jisx0301 (returns a Date object).
149153 #
150- def self._jisx0301 : (String str) -> Hash[Symbol, Integer]
154+ def self._jisx0301 : (String str, ?limit: Integer ) -> date_record
151155
152156 # <!--
153157 # rdoc-file=ext/date/date_core.c
@@ -192,7 +196,7 @@ class Date
192196 #
193197 # Related: Date.rfc2822 (returns a Date object).
194198 #
195- def self._rfc2822 : (String str) -> Hash[Symbol, Integer | String]
199+ def self._rfc2822 : (String str, ?limit: Integer ) -> datetime_with_timezone_record
196200
197201 # <!--
198202 # rdoc-file=ext/date/date_core.c
@@ -210,7 +214,7 @@ class Date
210214 #
211215 # Related: Date.rfc3339 (returns a Date object).
212216 #
213- def self._rfc3339 : (String str) -> Hash[Symbol, Integer | String]
217+ def self._rfc3339 : (String str, ?limit: Integer ) -> datetime_with_timezone_record
214218
215219 # <!--
216220 # rdoc-file=ext/date/date_core.c
@@ -228,7 +232,7 @@ class Date
228232 #
229233 # Related: Date.rfc2822 (returns a Date object).
230234 #
231- def self._rfc822 : (String str) -> Hash[Symbol, Integer | String]
235+ def self._rfc822 : (String str, ?limit: Integer ) -> datetime_with_timezone_record
232236
233237 # <!--
234238 # rdoc-file=ext/date/date_core.c
0 commit comments