usgs-ruby 1.0.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 +87 -0
- data/CHANGELOG.md +5 -0
- data/CODE_OF_CONDUCT.md +84 -0
- data/LICENSE.txt +21 -0
- data/README.md +256 -0
- data/Rakefile +24 -0
- data/docs/Usgs/Client.html +563 -0
- data/docs/Usgs/DailyValues.html +338 -0
- data/docs/Usgs/InstantaneousValues.html +329 -0
- data/docs/Usgs/Models/Reading.html +1124 -0
- data/docs/Usgs/Models/Site.html +2030 -0
- data/docs/Usgs/Models/Statistic.html +3981 -0
- data/docs/Usgs/Models.html +117 -0
- data/docs/Usgs/Parser.html +346 -0
- data/docs/Usgs/Parsers/RdbParser.html +354 -0
- data/docs/Usgs/Parsers/SiteParser.html +174 -0
- data/docs/Usgs/Parsers/StatisticsParser.html +228 -0
- data/docs/Usgs/Parsers/TimeSeriesParser.html +189 -0
- data/docs/Usgs/Parsers.html +117 -0
- data/docs/Usgs/Site.html +445 -0
- data/docs/Usgs/Statistics.html +335 -0
- data/docs/Usgs/Utils.html +357 -0
- data/docs/Usgs.html +303 -0
- data/docs/_index.html +286 -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 +111 -0
- data/docs/file_list.html +59 -0
- data/docs/frames.html +22 -0
- data/docs/index.html +111 -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 +598 -0
- data/docs/top-level-namespace.html +110 -0
- data/lib/usgs/client.rb +62 -0
- data/lib/usgs/daily_values.rb +38 -0
- data/lib/usgs/instantaneous_values.rb +35 -0
- data/lib/usgs/models/reading.rb +43 -0
- data/lib/usgs/models/site.rb +61 -0
- data/lib/usgs/models/statistic.rb +95 -0
- data/lib/usgs/parser.rb +23 -0
- data/lib/usgs/parsers/rdb_parser.rb +55 -0
- data/lib/usgs/parsers/site_parser.rb +13 -0
- data/lib/usgs/parsers/statistics_parser.rb +40 -0
- data/lib/usgs/parsers/time_series_parser.rb +54 -0
- data/lib/usgs/site.rb +50 -0
- data/lib/usgs/statistics.rb +42 -0
- data/lib/usgs/utils.rb +50 -0
- data/lib/usgs/version.rb +5 -0
- data/lib/usgs.rb +28 -0
- data/sig/usgs/ruby.rbs +6 -0
- data/usgs-ruby.gemspec +48 -0
- metadata +231 -0
|
@@ -0,0 +1,563 @@
|
|
|
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
|
+
Class: Usgs::Client
|
|
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 = "Usgs::Client";
|
|
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 (C)</a> »
|
|
40
|
+
<span class='title'><span class='object_link'><a href="../Usgs.html" title="Usgs (module)">Usgs</a></span></span>
|
|
41
|
+
»
|
|
42
|
+
<span class="title">Client</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>Class: Usgs::Client
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
</h1>
|
|
67
|
+
<div class="box_info">
|
|
68
|
+
|
|
69
|
+
<dl>
|
|
70
|
+
<dt>Inherits:</dt>
|
|
71
|
+
<dd>
|
|
72
|
+
<span class="inheritName">Object</span>
|
|
73
|
+
|
|
74
|
+
<ul class="fullTree">
|
|
75
|
+
<li>Object</li>
|
|
76
|
+
|
|
77
|
+
<li class="next">Usgs::Client</li>
|
|
78
|
+
|
|
79
|
+
</ul>
|
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
|
81
|
+
|
|
82
|
+
</dd>
|
|
83
|
+
</dl>
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
<dl>
|
|
91
|
+
<dt>Includes:</dt>
|
|
92
|
+
<dd><span class='object_link'><a href="DailyValues.html" title="Usgs::DailyValues (module)">DailyValues</a></span>, <span class='object_link'><a href="InstantaneousValues.html" title="Usgs::InstantaneousValues (module)">InstantaneousValues</a></span>, <span class='object_link'><a href="Site.html" title="Usgs::Site (module)">Site</a></span>, <span class='object_link'><a href="Statistics.html" title="Usgs::Statistics (module)">Statistics</a></span></dd>
|
|
93
|
+
</dl>
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
<dl>
|
|
101
|
+
<dt>Defined in:</dt>
|
|
102
|
+
<dd>lib/usgs/client.rb</dd>
|
|
103
|
+
</dl>
|
|
104
|
+
|
|
105
|
+
</div>
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
|
112
|
+
<ul class="summary">
|
|
113
|
+
|
|
114
|
+
<li class="public ">
|
|
115
|
+
<span class="summary_signature">
|
|
116
|
+
|
|
117
|
+
<a href="#timeout-instance_method" title="#timeout (instance method)">#<strong>timeout</strong> ⇒ Object </a>
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
</span>
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
<span class="note title readonly">readonly</span>
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
<span class="summary_desc"><div class='inline'>
|
|
137
|
+
<p>Returns the value of attribute timeout.</p>
|
|
138
|
+
</div></span>
|
|
139
|
+
|
|
140
|
+
</li>
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
<li class="public ">
|
|
144
|
+
<span class="summary_signature">
|
|
145
|
+
|
|
146
|
+
<a href="#user_agent-instance_method" title="#user_agent (instance method)">#<strong>user_agent</strong> ⇒ Object </a>
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
</span>
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
<span class="note title readonly">readonly</span>
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
<span class="summary_desc"><div class='inline'>
|
|
166
|
+
<p>Returns the value of attribute user_agent.</p>
|
|
167
|
+
</div></span>
|
|
168
|
+
|
|
169
|
+
</li>
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
</ul>
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
<h2>
|
|
179
|
+
Instance Method Summary
|
|
180
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
|
181
|
+
</h2>
|
|
182
|
+
|
|
183
|
+
<ul class="summary">
|
|
184
|
+
|
|
185
|
+
<li class="public ">
|
|
186
|
+
<span class="summary_signature">
|
|
187
|
+
|
|
188
|
+
<a href="#api_get-instance_method" title="#api_get (instance method)">#<strong>api_get</strong>(path, query = {}) ⇒ Object </a>
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
</span>
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
<span class="summary_desc"><div class='inline'>
|
|
203
|
+
<p>Public: Perform GET and return response from API.</p>
|
|
204
|
+
</div></span>
|
|
205
|
+
|
|
206
|
+
</li>
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
<li class="public ">
|
|
210
|
+
<span class="summary_signature">
|
|
211
|
+
|
|
212
|
+
<a href="#base_url-instance_method" title="#base_url (instance method)">#<strong>base_url</strong> ⇒ 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
|
+
<p>Base URL for USGS Water Services.</p>
|
|
228
|
+
</div></span>
|
|
229
|
+
|
|
230
|
+
</li>
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
<li class="public ">
|
|
234
|
+
<span class="summary_signature">
|
|
235
|
+
|
|
236
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(timeout: 30, user_agent: "usgs-ruby/#{Usgs::VERSION}", debug: false) ⇒ Client </a>
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
|
|
240
|
+
</span>
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
<span class="note title constructor">constructor</span>
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
<span class="summary_desc"><div class='inline'>
|
|
253
|
+
<p>A new instance of Client.</p>
|
|
254
|
+
</div></span>
|
|
255
|
+
|
|
256
|
+
</li>
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
</ul>
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="Statistics.html" title="Usgs::Statistics (module)">Statistics</a></span></h3>
|
|
272
|
+
<p class="inherited"><span class='object_link'><a href="Statistics.html#get_stats-instance_method" title="Usgs::Statistics#get_stats (method)">#get_stats</a></span></p>
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="Site.html" title="Usgs::Site (module)">Site</a></span></h3>
|
|
283
|
+
<p class="inherited"><span class='object_link'><a href="Site.html#get_sites-instance_method" title="Usgs::Site#get_sites (method)">#get_sites</a></span></p>
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="Utils.html" title="Usgs::Utils (module)">Utils</a></span></h3>
|
|
294
|
+
<p class="inherited"><span class='object_link'><a href="Utils.html#format_date-instance_method" title="Usgs::Utils#format_date (method)">#format_date</a></span>, <span class='object_link'><a href="Utils.html#format_datetime-instance_method" title="Usgs::Utils#format_datetime (method)">#format_datetime</a></span>, <span class='object_link'><a href="Utils.html#resolve_parameter_codes-instance_method" title="Usgs::Utils#resolve_parameter_codes (method)">#resolve_parameter_codes</a></span></p>
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="InstantaneousValues.html" title="Usgs::InstantaneousValues (module)">InstantaneousValues</a></span></h3>
|
|
305
|
+
<p class="inherited"><span class='object_link'><a href="InstantaneousValues.html#get_iv-instance_method" title="Usgs::InstantaneousValues#get_iv (method)">#get_iv</a></span></p>
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
<h3 class="inherited">Methods included from <span class='object_link'><a href="DailyValues.html" title="Usgs::DailyValues (module)">DailyValues</a></span></h3>
|
|
316
|
+
<p class="inherited"><span class='object_link'><a href="DailyValues.html#get_dv-instance_method" title="Usgs::DailyValues#get_dv (method)">#get_dv</a></span></p>
|
|
317
|
+
<div id="constructor_details" class="method_details_list">
|
|
318
|
+
<h2>Constructor Details</h2>
|
|
319
|
+
|
|
320
|
+
<div class="method_details first">
|
|
321
|
+
<h3 class="signature first" id="initialize-instance_method">
|
|
322
|
+
|
|
323
|
+
#<strong>initialize</strong>(timeout: 30, user_agent: "usgs-ruby/#{Usgs::VERSION}", debug: false) ⇒ <tt><span class='object_link'><a href="" title="Usgs::Client (class)">Client</a></span></tt>
|
|
324
|
+
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
</h3><div class="docstring">
|
|
330
|
+
<div class="discussion">
|
|
331
|
+
|
|
332
|
+
<p>Returns a new instance of Client.</p>
|
|
333
|
+
|
|
334
|
+
|
|
335
|
+
</div>
|
|
336
|
+
</div>
|
|
337
|
+
<div class="tags">
|
|
338
|
+
|
|
339
|
+
|
|
340
|
+
</div><table class="source_code">
|
|
341
|
+
<tr>
|
|
342
|
+
<td>
|
|
343
|
+
<pre class="lines">
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
12
|
|
347
|
+
13
|
|
348
|
+
14
|
|
349
|
+
15
|
|
350
|
+
16</pre>
|
|
351
|
+
</td>
|
|
352
|
+
<td>
|
|
353
|
+
<pre class="code"><span class="info file"># File 'lib/usgs/client.rb', line 12</span>
|
|
354
|
+
|
|
355
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>timeout:</span> <span class='int'>30</span><span class='comma'>,</span> <span class='label'>user_agent:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>usgs-ruby/</span><span class='embexpr_beg'>#{</span><span class='const'><span class='object_link'><a href="../Usgs.html" title="Usgs (module)">Usgs</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="../Usgs.html#VERSION-constant" title="Usgs::VERSION (constant)">VERSION</a></span></span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span><span class='comma'>,</span> <span class='label'>debug:</span> <span class='kw'>false</span><span class='rparen'>)</span>
|
|
356
|
+
<span class='ivar'>@timeout</span> <span class='op'>=</span> <span class='id identifier rubyid_timeout'>timeout</span>
|
|
357
|
+
<span class='ivar'>@user_agent</span> <span class='op'>=</span> <span class='id identifier rubyid_user_agent'>user_agent</span>
|
|
358
|
+
<span class='ivar'>@debug</span> <span class='op'>=</span> <span class='id identifier rubyid_debug'>debug</span>
|
|
359
|
+
<span class='kw'>end</span></pre>
|
|
360
|
+
</td>
|
|
361
|
+
</tr>
|
|
362
|
+
</table>
|
|
363
|
+
</div>
|
|
364
|
+
|
|
365
|
+
</div>
|
|
366
|
+
|
|
367
|
+
<div id="instance_attr_details" class="attr_details">
|
|
368
|
+
<h2>Instance Attribute Details</h2>
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
<span id=""></span>
|
|
372
|
+
<div class="method_details first">
|
|
373
|
+
<h3 class="signature first" id="timeout-instance_method">
|
|
374
|
+
|
|
375
|
+
#<strong>timeout</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
376
|
+
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
</h3><div class="docstring">
|
|
382
|
+
<div class="discussion">
|
|
383
|
+
|
|
384
|
+
<p>Returns the value of attribute timeout.</p>
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
</div>
|
|
388
|
+
</div>
|
|
389
|
+
<div class="tags">
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
</div><table class="source_code">
|
|
393
|
+
<tr>
|
|
394
|
+
<td>
|
|
395
|
+
<pre class="lines">
|
|
396
|
+
|
|
397
|
+
|
|
398
|
+
10
|
|
399
|
+
11
|
|
400
|
+
12</pre>
|
|
401
|
+
</td>
|
|
402
|
+
<td>
|
|
403
|
+
<pre class="code"><span class="info file"># File 'lib/usgs/client.rb', line 10</span>
|
|
404
|
+
|
|
405
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_timeout'>timeout</span>
|
|
406
|
+
<span class='ivar'>@timeout</span>
|
|
407
|
+
<span class='kw'>end</span></pre>
|
|
408
|
+
</td>
|
|
409
|
+
</tr>
|
|
410
|
+
</table>
|
|
411
|
+
</div>
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
<span id=""></span>
|
|
415
|
+
<div class="method_details ">
|
|
416
|
+
<h3 class="signature " id="user_agent-instance_method">
|
|
417
|
+
|
|
418
|
+
#<strong>user_agent</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
|
|
424
|
+
</h3><div class="docstring">
|
|
425
|
+
<div class="discussion">
|
|
426
|
+
|
|
427
|
+
<p>Returns the value of attribute user_agent.</p>
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
</div>
|
|
431
|
+
</div>
|
|
432
|
+
<div class="tags">
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
</div><table class="source_code">
|
|
436
|
+
<tr>
|
|
437
|
+
<td>
|
|
438
|
+
<pre class="lines">
|
|
439
|
+
|
|
440
|
+
|
|
441
|
+
10
|
|
442
|
+
11
|
|
443
|
+
12</pre>
|
|
444
|
+
</td>
|
|
445
|
+
<td>
|
|
446
|
+
<pre class="code"><span class="info file"># File 'lib/usgs/client.rb', line 10</span>
|
|
447
|
+
|
|
448
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_user_agent'>user_agent</span>
|
|
449
|
+
<span class='ivar'>@user_agent</span>
|
|
450
|
+
<span class='kw'>end</span></pre>
|
|
451
|
+
</td>
|
|
452
|
+
</tr>
|
|
453
|
+
</table>
|
|
454
|
+
</div>
|
|
455
|
+
|
|
456
|
+
</div>
|
|
457
|
+
|
|
458
|
+
|
|
459
|
+
<div id="instance_method_details" class="method_details_list">
|
|
460
|
+
<h2>Instance Method Details</h2>
|
|
461
|
+
|
|
462
|
+
|
|
463
|
+
<div class="method_details first">
|
|
464
|
+
<h3 class="signature first" id="api_get-instance_method">
|
|
465
|
+
|
|
466
|
+
#<strong>api_get</strong>(path, query = {}) ⇒ <tt>Object</tt>
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
</h3><div class="docstring">
|
|
473
|
+
<div class="discussion">
|
|
474
|
+
|
|
475
|
+
<p>Public: Perform GET and return response from API</p>
|
|
476
|
+
|
|
477
|
+
|
|
478
|
+
</div>
|
|
479
|
+
</div>
|
|
480
|
+
<div class="tags">
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
</div><table class="source_code">
|
|
484
|
+
<tr>
|
|
485
|
+
<td>
|
|
486
|
+
<pre class="lines">
|
|
487
|
+
|
|
488
|
+
|
|
489
|
+
24
|
|
490
|
+
25
|
|
491
|
+
26
|
|
492
|
+
27
|
|
493
|
+
28
|
|
494
|
+
29</pre>
|
|
495
|
+
</td>
|
|
496
|
+
<td>
|
|
497
|
+
<pre class="code"><span class="info file"># File 'lib/usgs/client.rb', line 24</span>
|
|
498
|
+
|
|
499
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_api_get'>api_get</span><span class='lparen'>(</span><span class='id identifier rubyid_path'>path</span><span class='comma'>,</span> <span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
|
500
|
+
<span class='id identifier rubyid_query'>query</span> <span class='op'>=</span> <span class='id identifier rubyid_query'>query</span><span class='period'>.</span><span class='id identifier rubyid_compact'>compact</span>
|
|
501
|
+
<span class='id identifier rubyid_url'>url</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_base_url'>base_url</span><span class='embexpr_end'>}</span><span class='embexpr_beg'>#{</span><span class='id identifier rubyid_path'>path</span><span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
|
502
|
+
|
|
503
|
+
<span class='id identifier rubyid_fetch_url'>fetch_url</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='label'>query:</span> <span class='id identifier rubyid_query'>query</span><span class='comma'>,</span> <span class='label'>timeout:</span> <span class='id identifier rubyid_timeout'>timeout</span><span class='comma'>,</span> <span class='label'>user_agent:</span> <span class='id identifier rubyid_user_agent'>user_agent</span><span class='rparen'>)</span>
|
|
504
|
+
<span class='kw'>end</span></pre>
|
|
505
|
+
</td>
|
|
506
|
+
</tr>
|
|
507
|
+
</table>
|
|
508
|
+
</div>
|
|
509
|
+
|
|
510
|
+
<div class="method_details ">
|
|
511
|
+
<h3 class="signature " id="base_url-instance_method">
|
|
512
|
+
|
|
513
|
+
#<strong>base_url</strong> ⇒ <tt>Object</tt>
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
</h3><div class="docstring">
|
|
520
|
+
<div class="discussion">
|
|
521
|
+
|
|
522
|
+
<p>Base URL for USGS Water Services</p>
|
|
523
|
+
|
|
524
|
+
|
|
525
|
+
</div>
|
|
526
|
+
</div>
|
|
527
|
+
<div class="tags">
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
</div><table class="source_code">
|
|
531
|
+
<tr>
|
|
532
|
+
<td>
|
|
533
|
+
<pre class="lines">
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
19
|
|
537
|
+
20
|
|
538
|
+
21</pre>
|
|
539
|
+
</td>
|
|
540
|
+
<td>
|
|
541
|
+
<pre class="code"><span class="info file"># File 'lib/usgs/client.rb', line 19</span>
|
|
542
|
+
|
|
543
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_base_url'>base_url</span>
|
|
544
|
+
<span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>https://waterservices.usgs.gov/nwis</span><span class='tstring_end'>"</span></span>
|
|
545
|
+
<span class='kw'>end</span></pre>
|
|
546
|
+
</td>
|
|
547
|
+
</tr>
|
|
548
|
+
</table>
|
|
549
|
+
</div>
|
|
550
|
+
|
|
551
|
+
</div>
|
|
552
|
+
|
|
553
|
+
</div>
|
|
554
|
+
|
|
555
|
+
<div id="footer">
|
|
556
|
+
Generated on Mon Dec 15 21:52:18 2025 by
|
|
557
|
+
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
558
|
+
0.9.37 (ruby-3.2.2).
|
|
559
|
+
</div>
|
|
560
|
+
|
|
561
|
+
</div>
|
|
562
|
+
</body>
|
|
563
|
+
</html>
|