dwh 0.1.0
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 +7 -0
- data/.rubocop.yml +36 -0
- data/CHANGELOG.md +5 -0
- data/LICENSE +21 -0
- data/README.md +130 -0
- data/Rakefile +42 -0
- data/docs/DWH/Adapters/Adapter.html +3053 -0
- data/docs/DWH/Adapters/Athena.html +1704 -0
- data/docs/DWH/Adapters/Boolean.html +121 -0
- data/docs/DWH/Adapters/Druid.html +1626 -0
- data/docs/DWH/Adapters/DuckDb.html +2012 -0
- data/docs/DWH/Adapters/MySql.html +1704 -0
- data/docs/DWH/Adapters/OpenAuthorizable/ClassMethods.html +265 -0
- data/docs/DWH/Adapters/OpenAuthorizable.html +1102 -0
- data/docs/DWH/Adapters/Postgres.html +2000 -0
- data/docs/DWH/Adapters/Snowflake.html +1662 -0
- data/docs/DWH/Adapters/SqlServer.html +2084 -0
- data/docs/DWH/Adapters/Trino.html +1835 -0
- data/docs/DWH/Adapters.html +129 -0
- data/docs/DWH/AuthenticationError.html +142 -0
- data/docs/DWH/Behaviors.html +767 -0
- data/docs/DWH/Capabilities.html +748 -0
- data/docs/DWH/Column.html +1115 -0
- data/docs/DWH/ConfigError.html +143 -0
- data/docs/DWH/ConnectionError.html +143 -0
- data/docs/DWH/DWHError.html +138 -0
- data/docs/DWH/ExecutionError.html +143 -0
- data/docs/DWH/Factory.html +1133 -0
- data/docs/DWH/Functions/Arrays.html +505 -0
- data/docs/DWH/Functions/Dates.html +1644 -0
- data/docs/DWH/Functions/ExtractDatePart.html +804 -0
- data/docs/DWH/Functions/Nulls.html +377 -0
- data/docs/DWH/Functions.html +846 -0
- data/docs/DWH/Logger.html +258 -0
- data/docs/DWH/OAuthError.html +138 -0
- data/docs/DWH/Settings.html +658 -0
- data/docs/DWH/StreamingStats.html +804 -0
- data/docs/DWH/Table.html +1260 -0
- data/docs/DWH/TableStats.html +583 -0
- data/docs/DWH/TokenExpiredError.html +142 -0
- data/docs/DWH/UnsupportedCapability.html +135 -0
- data/docs/DWH.html +220 -0
- data/docs/_index.html +471 -0
- data/docs/class_list.html +54 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +503 -0
- data/docs/file.README.html +210 -0
- data/docs/file.adapters.html +514 -0
- data/docs/file.creating-adapters.html +497 -0
- data/docs/file.getting-started.html +288 -0
- data/docs/file.usage.html +446 -0
- data/docs/file_list.html +79 -0
- data/docs/frames.html +22 -0
- data/docs/guides/adapters.md +445 -0
- data/docs/guides/creating-adapters.md +430 -0
- data/docs/guides/getting-started.md +225 -0
- data/docs/guides/usage.md +378 -0
- data/docs/index.html +210 -0
- data/docs/js/app.js +344 -0
- data/docs/js/full_list.js +242 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +2038 -0
- data/docs/top-level-namespace.html +110 -0
- data/lib/dwh/adapters/athena.rb +359 -0
- data/lib/dwh/adapters/druid.rb +267 -0
- data/lib/dwh/adapters/duck_db.rb +235 -0
- data/lib/dwh/adapters/my_sql.rb +235 -0
- data/lib/dwh/adapters/open_authorizable.rb +215 -0
- data/lib/dwh/adapters/postgres.rb +250 -0
- data/lib/dwh/adapters/snowflake.rb +489 -0
- data/lib/dwh/adapters/sql_server.rb +257 -0
- data/lib/dwh/adapters/trino.rb +213 -0
- data/lib/dwh/adapters.rb +363 -0
- data/lib/dwh/behaviors.rb +67 -0
- data/lib/dwh/capabilities.rb +39 -0
- data/lib/dwh/column.rb +79 -0
- data/lib/dwh/errors.rb +29 -0
- data/lib/dwh/factory.rb +125 -0
- data/lib/dwh/functions/arrays.rb +42 -0
- data/lib/dwh/functions/dates.rb +162 -0
- data/lib/dwh/functions/extract_date_part.rb +70 -0
- data/lib/dwh/functions/nulls.rb +31 -0
- data/lib/dwh/functions.rb +86 -0
- data/lib/dwh/logger.rb +50 -0
- data/lib/dwh/settings/athena.yml +77 -0
- data/lib/dwh/settings/base.yml +81 -0
- data/lib/dwh/settings/databricks.yml +51 -0
- data/lib/dwh/settings/druid.yml +59 -0
- data/lib/dwh/settings/duckdb.yml +44 -0
- data/lib/dwh/settings/mysql.yml +67 -0
- data/lib/dwh/settings/postgres.yml +30 -0
- data/lib/dwh/settings/redshift.yml +52 -0
- data/lib/dwh/settings/snowflake.yml +45 -0
- data/lib/dwh/settings/sqlserver.yml +80 -0
- data/lib/dwh/settings/trino.yml +77 -0
- data/lib/dwh/settings.rb +79 -0
- data/lib/dwh/streaming_stats.rb +69 -0
- data/lib/dwh/table.rb +105 -0
- data/lib/dwh/table_stats.rb +51 -0
- data/lib/dwh/version.rb +5 -0
- data/lib/dwh.rb +54 -0
- data/sig/dwh.rbs +4 -0
- metadata +231 -0
@@ -0,0 +1,804 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Module: DWH::Functions::ExtractDatePart
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.37
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "DWH::Functions::ExtractDatePart";
|
19
|
+
relpath = '../../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../../_index.html">Index (E)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../DWH.html" title="DWH (module)">DWH</a></span></span> » <span class='title'><span class='object_link'><a href="../Functions.html" title="DWH::Functions (module)">Functions</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">ExtractDatePart</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Module: DWH::Functions::ExtractDatePart
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
<dl>
|
78
|
+
<dt>Included in:</dt>
|
79
|
+
<dd><span class='object_link'><a href="../Functions.html" title="DWH::Functions (module)">DWH::Functions</a></span></dd>
|
80
|
+
</dl>
|
81
|
+
|
82
|
+
|
83
|
+
|
84
|
+
<dl>
|
85
|
+
<dt>Defined in:</dt>
|
86
|
+
<dd>lib/dwh/functions/extract_date_part.rb</dd>
|
87
|
+
</dl>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<h2>Overview</h2><div class="docstring">
|
92
|
+
<div class="discussion">
|
93
|
+
<p>All date functions related to extracting part of date
|
94
|
+
from a date or timestamp.</p>
|
95
|
+
|
96
|
+
|
97
|
+
</div>
|
98
|
+
</div>
|
99
|
+
<div class="tags">
|
100
|
+
|
101
|
+
|
102
|
+
</div>
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
<h2>
|
111
|
+
Instance Method Summary
|
112
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
113
|
+
</h2>
|
114
|
+
|
115
|
+
<ul class="summary">
|
116
|
+
|
117
|
+
<li class="public ">
|
118
|
+
<span class="summary_signature">
|
119
|
+
|
120
|
+
<a href="#extract_day_name-instance_method" title="#extract_day_name (instance method)">#<strong>extract_day_name</strong>(exp, abbreviate: false) ⇒ Object </a>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
</span>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
<span class="summary_desc"><div class='inline'>
|
135
|
+
</div></span>
|
136
|
+
|
137
|
+
</li>
|
138
|
+
|
139
|
+
|
140
|
+
<li class="public ">
|
141
|
+
<span class="summary_signature">
|
142
|
+
|
143
|
+
<a href="#extract_day_of_month-instance_method" title="#extract_day_of_month (instance method)">#<strong>extract_day_of_month</strong>(exp) ⇒ Object </a>
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
</span>
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
|
+
<span class="summary_desc"><div class='inline'>
|
158
|
+
</div></span>
|
159
|
+
|
160
|
+
</li>
|
161
|
+
|
162
|
+
|
163
|
+
<li class="public ">
|
164
|
+
<span class="summary_signature">
|
165
|
+
|
166
|
+
<a href="#extract_day_of_week-instance_method" title="#extract_day_of_week (instance method)">#<strong>extract_day_of_week</strong>(exp) ⇒ Object </a>
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
</span>
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
<span class="summary_desc"><div class='inline'>
|
181
|
+
</div></span>
|
182
|
+
|
183
|
+
</li>
|
184
|
+
|
185
|
+
|
186
|
+
<li class="public ">
|
187
|
+
<span class="summary_signature">
|
188
|
+
|
189
|
+
<a href="#extract_day_of_year-instance_method" title="#extract_day_of_year (instance method)">#<strong>extract_day_of_year</strong>(exp) ⇒ Object </a>
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
</span>
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
<span class="summary_desc"><div class='inline'>
|
204
|
+
</div></span>
|
205
|
+
|
206
|
+
</li>
|
207
|
+
|
208
|
+
|
209
|
+
<li class="public ">
|
210
|
+
<span class="summary_signature">
|
211
|
+
|
212
|
+
<a href="#extract_hour-instance_method" title="#extract_hour (instance method)">#<strong>extract_hour</strong>(exp) ⇒ Object </a>
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
</span>
|
217
|
+
|
218
|
+
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
<span class="summary_desc"><div class='inline'>
|
227
|
+
</div></span>
|
228
|
+
|
229
|
+
</li>
|
230
|
+
|
231
|
+
|
232
|
+
<li class="public ">
|
233
|
+
<span class="summary_signature">
|
234
|
+
|
235
|
+
<a href="#extract_minute-instance_method" title="#extract_minute (instance method)">#<strong>extract_minute</strong>(exp) ⇒ Object </a>
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
</span>
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
|
249
|
+
<span class="summary_desc"><div class='inline'>
|
250
|
+
</div></span>
|
251
|
+
|
252
|
+
</li>
|
253
|
+
|
254
|
+
|
255
|
+
<li class="public ">
|
256
|
+
<span class="summary_signature">
|
257
|
+
|
258
|
+
<a href="#extract_month-instance_method" title="#extract_month (instance method)">#<strong>extract_month</strong>(exp) ⇒ Object </a>
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
</span>
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
<span class="summary_desc"><div class='inline'>
|
273
|
+
</div></span>
|
274
|
+
|
275
|
+
</li>
|
276
|
+
|
277
|
+
|
278
|
+
<li class="public ">
|
279
|
+
<span class="summary_signature">
|
280
|
+
|
281
|
+
<a href="#extract_month_name-instance_method" title="#extract_month_name (instance method)">#<strong>extract_month_name</strong>(exp, abbreviate: false) ⇒ Object </a>
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
</span>
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
|
290
|
+
|
291
|
+
|
292
|
+
|
293
|
+
|
294
|
+
|
295
|
+
<span class="summary_desc"><div class='inline'>
|
296
|
+
</div></span>
|
297
|
+
|
298
|
+
</li>
|
299
|
+
|
300
|
+
|
301
|
+
<li class="public ">
|
302
|
+
<span class="summary_signature">
|
303
|
+
|
304
|
+
<a href="#extract_quarter-instance_method" title="#extract_quarter (instance method)">#<strong>extract_quarter</strong>(exp) ⇒ Object </a>
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
</span>
|
309
|
+
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
|
316
|
+
|
317
|
+
|
318
|
+
<span class="summary_desc"><div class='inline'>
|
319
|
+
</div></span>
|
320
|
+
|
321
|
+
</li>
|
322
|
+
|
323
|
+
|
324
|
+
<li class="public ">
|
325
|
+
<span class="summary_signature">
|
326
|
+
|
327
|
+
<a href="#extract_week_of_year-instance_method" title="#extract_week_of_year (instance method)">#<strong>extract_week_of_year</strong>(exp) ⇒ Object </a>
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
</span>
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
<span class="summary_desc"><div class='inline'>
|
342
|
+
</div></span>
|
343
|
+
|
344
|
+
</li>
|
345
|
+
|
346
|
+
|
347
|
+
<li class="public ">
|
348
|
+
<span class="summary_signature">
|
349
|
+
|
350
|
+
<a href="#extract_year-instance_method" title="#extract_year (instance method)">#<strong>extract_year</strong>(exp) ⇒ Object </a>
|
351
|
+
|
352
|
+
|
353
|
+
|
354
|
+
</span>
|
355
|
+
|
356
|
+
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
|
364
|
+
<span class="summary_desc"><div class='inline'>
|
365
|
+
</div></span>
|
366
|
+
|
367
|
+
</li>
|
368
|
+
|
369
|
+
|
370
|
+
<li class="public ">
|
371
|
+
<span class="summary_signature">
|
372
|
+
|
373
|
+
<a href="#extract_year_month-instance_method" title="#extract_year_month (instance method)">#<strong>extract_year_month</strong>(exp) ⇒ Object </a>
|
374
|
+
|
375
|
+
|
376
|
+
|
377
|
+
</span>
|
378
|
+
|
379
|
+
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
|
386
|
+
|
387
|
+
<span class="summary_desc"><div class='inline'>
|
388
|
+
</div></span>
|
389
|
+
|
390
|
+
</li>
|
391
|
+
|
392
|
+
|
393
|
+
</ul>
|
394
|
+
|
395
|
+
|
396
|
+
|
397
|
+
|
398
|
+
<div id="instance_method_details" class="method_details_list">
|
399
|
+
<h2>Instance Method Details</h2>
|
400
|
+
|
401
|
+
|
402
|
+
<div class="method_details first">
|
403
|
+
<h3 class="signature first" id="extract_day_name-instance_method">
|
404
|
+
|
405
|
+
#<strong>extract_day_name</strong>(exp, abbreviate: false) ⇒ <tt>Object</tt>
|
406
|
+
|
407
|
+
|
408
|
+
|
409
|
+
|
410
|
+
|
411
|
+
</h3><table class="source_code">
|
412
|
+
<tr>
|
413
|
+
<td>
|
414
|
+
<pre class="lines">
|
415
|
+
|
416
|
+
|
417
|
+
46
|
418
|
+
47
|
419
|
+
48
|
420
|
+
49
|
421
|
+
50
|
422
|
+
51
|
423
|
+
52
|
424
|
+
53
|
425
|
+
54
|
426
|
+
55</pre>
|
427
|
+
</td>
|
428
|
+
<td>
|
429
|
+
<pre class="code"><span class="info file"># File 'lib/dwh/functions/extract_date_part.rb', line 46</span>
|
430
|
+
|
431
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_extract_day_name'>extract_day_name</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='comma'>,</span> <span class='label'>abbreviate:</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
432
|
+
<span class='id identifier rubyid_upper_case'>upper_case</span><span class='lparen'>(</span>
|
433
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_abbreviate'>abbreviate</span>
|
434
|
+
<span class='id identifier rubyid_date_format_sql'>date_format_sql</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='comma'>,</span>
|
435
|
+
<span class='id identifier rubyid_gsk'>gsk</span><span class='lparen'>(</span><span class='symbol'>:abbreviated_day_name_format</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
436
|
+
<span class='kw'>else</span>
|
437
|
+
<span class='id identifier rubyid_date_format_sql'>date_format_sql</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='comma'>,</span> <span class='id identifier rubyid_gsk'>gsk</span><span class='lparen'>(</span><span class='symbol'>:day_name_format</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
438
|
+
<span class='kw'>end</span>
|
439
|
+
<span class='rparen'>)</span>
|
440
|
+
<span class='kw'>end</span></pre>
|
441
|
+
</td>
|
442
|
+
</tr>
|
443
|
+
</table>
|
444
|
+
</div>
|
445
|
+
|
446
|
+
<div class="method_details ">
|
447
|
+
<h3 class="signature " id="extract_day_of_month-instance_method">
|
448
|
+
|
449
|
+
#<strong>extract_day_of_month</strong>(exp) ⇒ <tt>Object</tt>
|
450
|
+
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
|
455
|
+
</h3><table class="source_code">
|
456
|
+
<tr>
|
457
|
+
<td>
|
458
|
+
<pre class="lines">
|
459
|
+
|
460
|
+
|
461
|
+
22
|
462
|
+
23
|
463
|
+
24</pre>
|
464
|
+
</td>
|
465
|
+
<td>
|
466
|
+
<pre class="code"><span class="info file"># File 'lib/dwh/functions/extract_date_part.rb', line 22</span>
|
467
|
+
|
468
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_extract_day_of_month'>extract_day_of_month</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
469
|
+
<span class='id identifier rubyid_gsk'>gsk</span><span class='lparen'>(</span><span class='symbol'>:extract_day_of_month</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>@exp</span><span class='regexp_end'>/i</span></span><span class='comma'>,</span> <span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
470
|
+
<span class='kw'>end</span></pre>
|
471
|
+
</td>
|
472
|
+
</tr>
|
473
|
+
</table>
|
474
|
+
</div>
|
475
|
+
|
476
|
+
<div class="method_details ">
|
477
|
+
<h3 class="signature " id="extract_day_of_week-instance_method">
|
478
|
+
|
479
|
+
#<strong>extract_day_of_week</strong>(exp) ⇒ <tt>Object</tt>
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
</h3><table class="source_code">
|
486
|
+
<tr>
|
487
|
+
<td>
|
488
|
+
<pre class="lines">
|
489
|
+
|
490
|
+
|
491
|
+
26
|
492
|
+
27
|
493
|
+
28</pre>
|
494
|
+
</td>
|
495
|
+
<td>
|
496
|
+
<pre class="code"><span class="info file"># File 'lib/dwh/functions/extract_date_part.rb', line 26</span>
|
497
|
+
|
498
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_extract_day_of_week'>extract_day_of_week</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
499
|
+
<span class='id identifier rubyid_gsk'>gsk</span><span class='lparen'>(</span><span class='symbol'>:extract_day_of_week</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>@exp</span><span class='regexp_end'>/i</span></span><span class='comma'>,</span> <span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
500
|
+
<span class='kw'>end</span></pre>
|
501
|
+
</td>
|
502
|
+
</tr>
|
503
|
+
</table>
|
504
|
+
</div>
|
505
|
+
|
506
|
+
<div class="method_details ">
|
507
|
+
<h3 class="signature " id="extract_day_of_year-instance_method">
|
508
|
+
|
509
|
+
#<strong>extract_day_of_year</strong>(exp) ⇒ <tt>Object</tt>
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
|
514
|
+
|
515
|
+
</h3><table class="source_code">
|
516
|
+
<tr>
|
517
|
+
<td>
|
518
|
+
<pre class="lines">
|
519
|
+
|
520
|
+
|
521
|
+
18
|
522
|
+
19
|
523
|
+
20</pre>
|
524
|
+
</td>
|
525
|
+
<td>
|
526
|
+
<pre class="code"><span class="info file"># File 'lib/dwh/functions/extract_date_part.rb', line 18</span>
|
527
|
+
|
528
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_extract_day_of_year'>extract_day_of_year</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
529
|
+
<span class='id identifier rubyid_gsk'>gsk</span><span class='lparen'>(</span><span class='symbol'>:extract_day_of_year</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>@exp</span><span class='regexp_end'>/i</span></span><span class='comma'>,</span> <span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
530
|
+
<span class='kw'>end</span></pre>
|
531
|
+
</td>
|
532
|
+
</tr>
|
533
|
+
</table>
|
534
|
+
</div>
|
535
|
+
|
536
|
+
<div class="method_details ">
|
537
|
+
<h3 class="signature " id="extract_hour-instance_method">
|
538
|
+
|
539
|
+
#<strong>extract_hour</strong>(exp) ⇒ <tt>Object</tt>
|
540
|
+
|
541
|
+
|
542
|
+
|
543
|
+
|
544
|
+
|
545
|
+
</h3><table class="source_code">
|
546
|
+
<tr>
|
547
|
+
<td>
|
548
|
+
<pre class="lines">
|
549
|
+
|
550
|
+
|
551
|
+
34
|
552
|
+
35
|
553
|
+
36</pre>
|
554
|
+
</td>
|
555
|
+
<td>
|
556
|
+
<pre class="code"><span class="info file"># File 'lib/dwh/functions/extract_date_part.rb', line 34</span>
|
557
|
+
|
558
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_extract_hour'>extract_hour</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
559
|
+
<span class='id identifier rubyid_gsk'>gsk</span><span class='lparen'>(</span><span class='symbol'>:extract_hour</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>@exp</span><span class='regexp_end'>/i</span></span><span class='comma'>,</span> <span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
560
|
+
<span class='kw'>end</span></pre>
|
561
|
+
</td>
|
562
|
+
</tr>
|
563
|
+
</table>
|
564
|
+
</div>
|
565
|
+
|
566
|
+
<div class="method_details ">
|
567
|
+
<h3 class="signature " id="extract_minute-instance_method">
|
568
|
+
|
569
|
+
#<strong>extract_minute</strong>(exp) ⇒ <tt>Object</tt>
|
570
|
+
|
571
|
+
|
572
|
+
|
573
|
+
|
574
|
+
|
575
|
+
</h3><table class="source_code">
|
576
|
+
<tr>
|
577
|
+
<td>
|
578
|
+
<pre class="lines">
|
579
|
+
|
580
|
+
|
581
|
+
38
|
582
|
+
39
|
583
|
+
40</pre>
|
584
|
+
</td>
|
585
|
+
<td>
|
586
|
+
<pre class="code"><span class="info file"># File 'lib/dwh/functions/extract_date_part.rb', line 38</span>
|
587
|
+
|
588
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_extract_minute'>extract_minute</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
589
|
+
<span class='id identifier rubyid_gsk'>gsk</span><span class='lparen'>(</span><span class='symbol'>:extract_minute</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>@exp</span><span class='regexp_end'>/i</span></span><span class='comma'>,</span> <span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
590
|
+
<span class='kw'>end</span></pre>
|
591
|
+
</td>
|
592
|
+
</tr>
|
593
|
+
</table>
|
594
|
+
</div>
|
595
|
+
|
596
|
+
<div class="method_details ">
|
597
|
+
<h3 class="signature " id="extract_month-instance_method">
|
598
|
+
|
599
|
+
#<strong>extract_month</strong>(exp) ⇒ <tt>Object</tt>
|
600
|
+
|
601
|
+
|
602
|
+
|
603
|
+
|
604
|
+
|
605
|
+
</h3><table class="source_code">
|
606
|
+
<tr>
|
607
|
+
<td>
|
608
|
+
<pre class="lines">
|
609
|
+
|
610
|
+
|
611
|
+
10
|
612
|
+
11
|
613
|
+
12</pre>
|
614
|
+
</td>
|
615
|
+
<td>
|
616
|
+
<pre class="code"><span class="info file"># File 'lib/dwh/functions/extract_date_part.rb', line 10</span>
|
617
|
+
|
618
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_extract_month'>extract_month</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
619
|
+
<span class='id identifier rubyid_gsk'>gsk</span><span class='lparen'>(</span><span class='symbol'>:extract_month</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>@exp</span><span class='regexp_end'>/i</span></span><span class='comma'>,</span> <span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
620
|
+
<span class='kw'>end</span></pre>
|
621
|
+
</td>
|
622
|
+
</tr>
|
623
|
+
</table>
|
624
|
+
</div>
|
625
|
+
|
626
|
+
<div class="method_details ">
|
627
|
+
<h3 class="signature " id="extract_month_name-instance_method">
|
628
|
+
|
629
|
+
#<strong>extract_month_name</strong>(exp, abbreviate: false) ⇒ <tt>Object</tt>
|
630
|
+
|
631
|
+
|
632
|
+
|
633
|
+
|
634
|
+
|
635
|
+
</h3><table class="source_code">
|
636
|
+
<tr>
|
637
|
+
<td>
|
638
|
+
<pre class="lines">
|
639
|
+
|
640
|
+
|
641
|
+
57
|
642
|
+
58
|
643
|
+
59
|
644
|
+
60
|
645
|
+
61
|
646
|
+
62
|
647
|
+
63
|
648
|
+
64
|
649
|
+
65
|
650
|
+
66
|
651
|
+
67</pre>
|
652
|
+
</td>
|
653
|
+
<td>
|
654
|
+
<pre class="code"><span class="info file"># File 'lib/dwh/functions/extract_date_part.rb', line 57</span>
|
655
|
+
|
656
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_extract_month_name'>extract_month_name</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='comma'>,</span> <span class='label'>abbreviate:</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
657
|
+
<span class='id identifier rubyid_upper_case'>upper_case</span><span class='lparen'>(</span>
|
658
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_abbreviate'>abbreviate</span>
|
659
|
+
<span class='id identifier rubyid_date_format_sql'>date_format_sql</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='comma'>,</span>
|
660
|
+
<span class='id identifier rubyid_gsk'>gsk</span><span class='lparen'>(</span><span class='symbol'>:abbreviated_month_name_format</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
661
|
+
<span class='kw'>else</span>
|
662
|
+
<span class='id identifier rubyid_date_format_sql'>date_format_sql</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='comma'>,</span>
|
663
|
+
<span class='id identifier rubyid_gsk'>gsk</span><span class='lparen'>(</span><span class='symbol'>:month_name_format</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
664
|
+
<span class='kw'>end</span>
|
665
|
+
<span class='rparen'>)</span>
|
666
|
+
<span class='kw'>end</span></pre>
|
667
|
+
</td>
|
668
|
+
</tr>
|
669
|
+
</table>
|
670
|
+
</div>
|
671
|
+
|
672
|
+
<div class="method_details ">
|
673
|
+
<h3 class="signature " id="extract_quarter-instance_method">
|
674
|
+
|
675
|
+
#<strong>extract_quarter</strong>(exp) ⇒ <tt>Object</tt>
|
676
|
+
|
677
|
+
|
678
|
+
|
679
|
+
|
680
|
+
|
681
|
+
</h3><table class="source_code">
|
682
|
+
<tr>
|
683
|
+
<td>
|
684
|
+
<pre class="lines">
|
685
|
+
|
686
|
+
|
687
|
+
14
|
688
|
+
15
|
689
|
+
16</pre>
|
690
|
+
</td>
|
691
|
+
<td>
|
692
|
+
<pre class="code"><span class="info file"># File 'lib/dwh/functions/extract_date_part.rb', line 14</span>
|
693
|
+
|
694
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_extract_quarter'>extract_quarter</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
695
|
+
<span class='id identifier rubyid_gsk'>gsk</span><span class='lparen'>(</span><span class='symbol'>:extract_quarter</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>@exp</span><span class='regexp_end'>/i</span></span><span class='comma'>,</span> <span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
696
|
+
<span class='kw'>end</span></pre>
|
697
|
+
</td>
|
698
|
+
</tr>
|
699
|
+
</table>
|
700
|
+
</div>
|
701
|
+
|
702
|
+
<div class="method_details ">
|
703
|
+
<h3 class="signature " id="extract_week_of_year-instance_method">
|
704
|
+
|
705
|
+
#<strong>extract_week_of_year</strong>(exp) ⇒ <tt>Object</tt>
|
706
|
+
|
707
|
+
|
708
|
+
|
709
|
+
|
710
|
+
|
711
|
+
</h3><table class="source_code">
|
712
|
+
<tr>
|
713
|
+
<td>
|
714
|
+
<pre class="lines">
|
715
|
+
|
716
|
+
|
717
|
+
30
|
718
|
+
31
|
719
|
+
32</pre>
|
720
|
+
</td>
|
721
|
+
<td>
|
722
|
+
<pre class="code"><span class="info file"># File 'lib/dwh/functions/extract_date_part.rb', line 30</span>
|
723
|
+
|
724
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_extract_week_of_year'>extract_week_of_year</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
725
|
+
<span class='id identifier rubyid_gsk'>gsk</span><span class='lparen'>(</span><span class='symbol'>:extract_week_of_year</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>@exp</span><span class='regexp_end'>/i</span></span><span class='comma'>,</span> <span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
726
|
+
<span class='kw'>end</span></pre>
|
727
|
+
</td>
|
728
|
+
</tr>
|
729
|
+
</table>
|
730
|
+
</div>
|
731
|
+
|
732
|
+
<div class="method_details ">
|
733
|
+
<h3 class="signature " id="extract_year-instance_method">
|
734
|
+
|
735
|
+
#<strong>extract_year</strong>(exp) ⇒ <tt>Object</tt>
|
736
|
+
|
737
|
+
|
738
|
+
|
739
|
+
|
740
|
+
|
741
|
+
</h3><table class="source_code">
|
742
|
+
<tr>
|
743
|
+
<td>
|
744
|
+
<pre class="lines">
|
745
|
+
|
746
|
+
|
747
|
+
6
|
748
|
+
7
|
749
|
+
8</pre>
|
750
|
+
</td>
|
751
|
+
<td>
|
752
|
+
<pre class="code"><span class="info file"># File 'lib/dwh/functions/extract_date_part.rb', line 6</span>
|
753
|
+
|
754
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_extract_year'>extract_year</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
755
|
+
<span class='id identifier rubyid_gsk'>gsk</span><span class='lparen'>(</span><span class='symbol'>:extract_year</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>@exp</span><span class='regexp_end'>/i</span></span><span class='comma'>,</span> <span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
756
|
+
<span class='kw'>end</span></pre>
|
757
|
+
</td>
|
758
|
+
</tr>
|
759
|
+
</table>
|
760
|
+
</div>
|
761
|
+
|
762
|
+
<div class="method_details ">
|
763
|
+
<h3 class="signature " id="extract_year_month-instance_method">
|
764
|
+
|
765
|
+
#<strong>extract_year_month</strong>(exp) ⇒ <tt>Object</tt>
|
766
|
+
|
767
|
+
|
768
|
+
|
769
|
+
|
770
|
+
|
771
|
+
</h3><table class="source_code">
|
772
|
+
<tr>
|
773
|
+
<td>
|
774
|
+
<pre class="lines">
|
775
|
+
|
776
|
+
|
777
|
+
42
|
778
|
+
43
|
779
|
+
44</pre>
|
780
|
+
</td>
|
781
|
+
<td>
|
782
|
+
<pre class="code"><span class="info file"># File 'lib/dwh/functions/extract_date_part.rb', line 42</span>
|
783
|
+
|
784
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_extract_year_month'>extract_year_month</span><span class='lparen'>(</span><span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
785
|
+
<span class='id identifier rubyid_gsk'>gsk</span><span class='lparen'>(</span><span class='symbol'>:extract_year_month</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_gsub'>gsub</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>@exp</span><span class='regexp_end'>/i</span></span><span class='comma'>,</span> <span class='id identifier rubyid_exp'>exp</span><span class='rparen'>)</span>
|
786
|
+
<span class='kw'>end</span></pre>
|
787
|
+
</td>
|
788
|
+
</tr>
|
789
|
+
</table>
|
790
|
+
</div>
|
791
|
+
|
792
|
+
</div>
|
793
|
+
|
794
|
+
</div>
|
795
|
+
|
796
|
+
<div id="footer">
|
797
|
+
Generated on Fri Aug 22 08:31:21 2025 by
|
798
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
799
|
+
0.9.37 (ruby-3.4.4).
|
800
|
+
</div>
|
801
|
+
|
802
|
+
</div>
|
803
|
+
</body>
|
804
|
+
</html>
|