ldbws 1.0.2 → 1.0.4
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/.editorconfig +1 -1
- data/.ruby-version +1 -0
- data/Gemfile.lock +147 -49
- data/LICENSE +1 -1
- data/README.md +17 -11
- data/doc/LICENSE.html +403 -47
- data/doc/Ldbws/Request/GetDeparturesBoard.html +487 -54
- data/doc/Ldbws/Request/GetDeparturesBoardWithDetails.html +487 -54
- data/doc/Ldbws/Request/GetServiceDetails.html +484 -51
- data/doc/Ldbws/Request/GetStationBoard.html +489 -56
- data/doc/Ldbws/Request/GetStationBoardWithDetails.html +489 -56
- data/doc/Ldbws/Request/ParamValidationError.html +538 -69
- data/doc/Ldbws/Request.html +470 -47
- data/doc/Ldbws/RequestError.html +535 -72
- data/doc/Ldbws/ResponseParsingError.html +475 -49
- data/doc/Ldbws/ResponseTypes/BaseStationBoard.html +565 -56
- data/doc/Ldbws/ResponseTypes/CallingPoint.html +498 -65
- data/doc/Ldbws/ResponseTypes/Coach.html +487 -54
- data/doc/Ldbws/ResponseTypes/DepartureItem.html +485 -52
- data/doc/Ldbws/ResponseTypes/DepartureItemWithDetails.html +485 -52
- data/doc/Ldbws/ResponseTypes/DeparturesBoard.html +484 -51
- data/doc/Ldbws/ResponseTypes/DeparturesBoardWithDetails.html +484 -51
- data/doc/Ldbws/ResponseTypes/Formation.html +485 -52
- data/doc/Ldbws/ResponseTypes/LoadingCategory.html +486 -53
- data/doc/Ldbws/ResponseTypes/Location.html +486 -53
- data/doc/Ldbws/ResponseTypes/ServiceDetails.html +510 -77
- data/doc/Ldbws/ResponseTypes/ServiceItem.html +503 -70
- data/doc/Ldbws/ResponseTypes/ServiceItemWithCallingPoints.html +485 -52
- data/doc/Ldbws/ResponseTypes/StationBoard.html +486 -53
- data/doc/Ldbws/ResponseTypes/StationBoardWithDetails.html +486 -53
- data/doc/Ldbws/ResponseTypes/ToiletAvailability.html +485 -52
- data/doc/Ldbws/ResponseTypes.html +470 -47
- data/doc/Ldbws/Service.html +1083 -245
- data/doc/Ldbws.html +520 -73
- data/doc/README_md.html +14 -20
- data/doc/created.rid +19 -20
- data/doc/css/rdoc.css +1926 -378
- data/doc/index.html +441 -108
- data/doc/js/aliki.js +489 -0
- data/doc/js/bash_highlighter.js +167 -0
- data/doc/js/c_highlighter.js +299 -0
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search_controller.js +129 -0
- data/doc/js/search_data.js +1 -0
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/search_navigation.js +105 -0
- data/doc/js/search_ranker.js +239 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/js/theme-toggle.js +112 -0
- data/doc/table_of_contents.html +2 -3
- data/ldbws.gemspec +7 -6
- data/lib/ldbws/request/base.rb +0 -3
- data/lib/ldbws/request/get_departures_board.rb +5 -1
- data/lib/ldbws/request/get_service_details.rb +5 -1
- data/lib/ldbws/request/get_station_board.rb +14 -1
- data/lib/ldbws/response_types/calling_point.rb +2 -2
- data/lib/ldbws/response_types/station_board.rb +6 -0
- data/lib/ldbws/service.rb +2 -4
- data/lib/ldbws/version.rb +1 -1
- data/spec/helpers/request_helper.rb +27 -0
- data/spec/request/get_departures_board_spec.rb +55 -0
- data/spec/request/get_service_details_spec.rb +16 -0
- data/spec/request/get_station_board_spec.rb +73 -0
- metadata +29 -21
- data/.envrc +0 -1
data/doc/index.html
CHANGED
|
@@ -1,137 +1,450 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
|
|
3
|
-
<html>
|
|
3
|
+
<html lang="en">
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
7
|
|
|
7
8
|
<title>RDoc Documentation</title>
|
|
8
9
|
|
|
10
|
+
|
|
11
|
+
<meta name="keywords" content="ruby,documentation,RDoc Documentation">
|
|
12
|
+
|
|
13
|
+
<meta
|
|
14
|
+
name="description"
|
|
15
|
+
content="RDoc Documentation: lite. realtime."
|
|
16
|
+
>
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
<!-- Open Graph / Facebook -->
|
|
23
|
+
<meta property="og:type" content="website">
|
|
24
|
+
<meta property="og:title" content="RDoc Documentation">
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
<meta
|
|
28
|
+
property="og:description"
|
|
29
|
+
content="API documentation for RDoc Documentation - Browse classes, modules, and methods"
|
|
30
|
+
>
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
<!-- Twitter -->
|
|
36
|
+
<meta name="twitter:card" content="summary">
|
|
37
|
+
<meta name="twitter:title" content="RDoc Documentation">
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<meta
|
|
41
|
+
name="twitter:description"
|
|
42
|
+
content="API documentation for RDoc Documentation - Browse classes, modules, and methods"
|
|
43
|
+
>
|
|
44
|
+
|
|
45
|
+
|
|
9
46
|
<script type="text/javascript">
|
|
10
47
|
var rdoc_rel_prefix = "./";
|
|
11
48
|
var index_rel_prefix = "./";
|
|
12
49
|
</script>
|
|
13
50
|
|
|
14
|
-
<script
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<script
|
|
51
|
+
<script
|
|
52
|
+
src="./js/theme-toggle.js?v=8.1.0"
|
|
53
|
+
></script>
|
|
54
|
+
|
|
55
|
+
<script
|
|
56
|
+
src="./js/search_navigation.js?v=8.1.0"
|
|
57
|
+
defer
|
|
58
|
+
></script>
|
|
59
|
+
|
|
60
|
+
<script
|
|
61
|
+
src="./js/search_data.js?v=8.1.0"
|
|
62
|
+
defer
|
|
63
|
+
></script>
|
|
64
|
+
|
|
65
|
+
<script
|
|
66
|
+
src="./js/search_ranker.js?v=8.1.0"
|
|
67
|
+
defer
|
|
68
|
+
></script>
|
|
69
|
+
|
|
70
|
+
<script
|
|
71
|
+
src="./js/search_controller.js?v=8.1.0"
|
|
72
|
+
defer
|
|
73
|
+
></script>
|
|
74
|
+
|
|
75
|
+
<script
|
|
76
|
+
src="./js/c_highlighter.js?v=8.1.0"
|
|
77
|
+
defer
|
|
78
|
+
></script>
|
|
79
|
+
|
|
80
|
+
<script
|
|
81
|
+
src="./js/bash_highlighter.js?v=8.1.0"
|
|
82
|
+
defer
|
|
83
|
+
></script>
|
|
84
|
+
|
|
85
|
+
<script
|
|
86
|
+
src="./js/aliki.js?v=8.1.0"
|
|
87
|
+
defer
|
|
88
|
+
></script>
|
|
89
|
+
|
|
90
|
+
<link
|
|
91
|
+
href="./css/rdoc.css?v=8.1.0"
|
|
92
|
+
rel="stylesheet"
|
|
93
|
+
>
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
<body role="document" class="file has-toc">
|
|
99
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
|
|
100
|
+
<!-- Chevron (right arrow) - used for expand/collapse -->
|
|
101
|
+
<symbol
|
|
102
|
+
id="icon-chevron"
|
|
103
|
+
viewBox="0 0 24 24"
|
|
104
|
+
fill="none"
|
|
105
|
+
stroke="currentColor"
|
|
106
|
+
stroke-width="2"
|
|
107
|
+
stroke-linecap="round"
|
|
108
|
+
stroke-linejoin="round"
|
|
109
|
+
>
|
|
110
|
+
<polyline points="9 18 15 12 9 6"></polyline>
|
|
111
|
+
</symbol>
|
|
112
|
+
|
|
113
|
+
<!-- File/Document - Pages section -->
|
|
114
|
+
<symbol
|
|
115
|
+
id="icon-file"
|
|
116
|
+
viewBox="0 0 24 24"
|
|
117
|
+
fill="none"
|
|
118
|
+
stroke="currentColor"
|
|
119
|
+
stroke-width="2"
|
|
120
|
+
stroke-linecap="round"
|
|
121
|
+
stroke-linejoin="round"
|
|
122
|
+
>
|
|
123
|
+
<path
|
|
124
|
+
d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"
|
|
125
|
+
></path>
|
|
126
|
+
|
|
127
|
+
<polyline points="14 2 14 8 20 8"></polyline>
|
|
128
|
+
</symbol>
|
|
129
|
+
|
|
130
|
+
<!-- Layers/Stack - Classes and Modules section -->
|
|
131
|
+
<symbol
|
|
132
|
+
id="icon-layers"
|
|
133
|
+
viewBox="0 0 24 24"
|
|
134
|
+
fill="none"
|
|
135
|
+
stroke="currentColor"
|
|
136
|
+
stroke-width="2"
|
|
137
|
+
stroke-linecap="round"
|
|
138
|
+
stroke-linejoin="round"
|
|
139
|
+
>
|
|
140
|
+
<polygon points="12 2 2 7 12 12 22 7 12 2"></polygon>
|
|
141
|
+
<polyline points="2 17 12 22 22 17"></polyline>
|
|
142
|
+
<polyline points="2 12 12 17 22 12"></polyline>
|
|
143
|
+
</symbol>
|
|
144
|
+
|
|
145
|
+
<!-- Curly braces with C - Class Methods section -->
|
|
146
|
+
<symbol
|
|
147
|
+
id="icon-class-methods"
|
|
148
|
+
viewBox="0 0 24 24"
|
|
149
|
+
fill="none"
|
|
150
|
+
stroke="currentColor"
|
|
151
|
+
stroke-width="2"
|
|
152
|
+
stroke-linecap="round"
|
|
153
|
+
stroke-linejoin="round"
|
|
154
|
+
>
|
|
155
|
+
<path d="M6 3C3.5 3 2 4.5 2 7v3c0 1.5-1 2-1 2s1 .5 1 2v5c0 2.5 1.5 4 4 4"></path>
|
|
156
|
+
<path d="M18 3c2.5 0 4 1.5 4 4v3c0 1.5 1 2 1 2s-1 .5-1 2v5c0 2.5-1.5 4-4 4"></path>
|
|
157
|
+
|
|
158
|
+
<text
|
|
159
|
+
x="12"
|
|
160
|
+
y="17"
|
|
161
|
+
text-anchor="middle"
|
|
162
|
+
font-size="13"
|
|
163
|
+
font-weight="bold"
|
|
164
|
+
fill="currentColor"
|
|
165
|
+
stroke="none"
|
|
166
|
+
>
|
|
167
|
+
C
|
|
168
|
+
</text>
|
|
169
|
+
</symbol>
|
|
170
|
+
|
|
171
|
+
<!-- Curly braces with I - Instance Methods section -->
|
|
172
|
+
<symbol
|
|
173
|
+
id="icon-instance-methods"
|
|
174
|
+
viewBox="0 0 24 24"
|
|
175
|
+
fill="none"
|
|
176
|
+
stroke="currentColor"
|
|
177
|
+
stroke-width="2"
|
|
178
|
+
stroke-linecap="round"
|
|
179
|
+
stroke-linejoin="round"
|
|
180
|
+
>
|
|
181
|
+
<path d="M6 3C3.5 3 2 4.5 2 7v3c0 1.5-1 2-1 2s1 .5 1 2v5c0 2.5 1.5 4 4 4"></path>
|
|
182
|
+
<path d="M18 3c2.5 0 4 1.5 4 4v3c0 1.5 1 2 1 2s-1 .5-1 2v5c0 2.5-1.5 4-4 4"></path>
|
|
183
|
+
|
|
184
|
+
<text
|
|
185
|
+
x="12"
|
|
186
|
+
y="17"
|
|
187
|
+
text-anchor="middle"
|
|
188
|
+
font-size="13"
|
|
189
|
+
font-weight="bold"
|
|
190
|
+
fill="currentColor"
|
|
191
|
+
stroke="none"
|
|
192
|
+
>
|
|
193
|
+
I
|
|
194
|
+
</text>
|
|
195
|
+
</symbol>
|
|
196
|
+
|
|
197
|
+
<!-- Double chevrons up - Ancestors section -->
|
|
198
|
+
<symbol
|
|
199
|
+
id="icon-ancestors"
|
|
200
|
+
viewBox="0 0 24 24"
|
|
201
|
+
fill="none"
|
|
202
|
+
stroke="currentColor"
|
|
203
|
+
stroke-width="2"
|
|
204
|
+
stroke-linecap="round"
|
|
205
|
+
stroke-linejoin="round"
|
|
206
|
+
>
|
|
207
|
+
<polyline points="17 11 12 6 7 11"></polyline>
|
|
208
|
+
<polyline points="17 18 12 13 7 18"></polyline>
|
|
209
|
+
</symbol>
|
|
210
|
+
|
|
211
|
+
<!-- User with plus - Included Modules section -->
|
|
212
|
+
<symbol
|
|
213
|
+
id="icon-includes"
|
|
214
|
+
viewBox="0 0 24 24"
|
|
215
|
+
fill="none"
|
|
216
|
+
stroke="currentColor"
|
|
217
|
+
stroke-width="2"
|
|
218
|
+
stroke-linecap="round"
|
|
219
|
+
stroke-linejoin="round"
|
|
220
|
+
>
|
|
221
|
+
<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
|
|
222
|
+
<circle cx="8.5" cy="7" r="4"></circle>
|
|
223
|
+
|
|
224
|
+
<line
|
|
225
|
+
x1="20"
|
|
226
|
+
y1="8"
|
|
227
|
+
x2="20"
|
|
228
|
+
y2="14"
|
|
229
|
+
></line>
|
|
230
|
+
|
|
231
|
+
<line
|
|
232
|
+
x1="23"
|
|
233
|
+
y1="11"
|
|
234
|
+
x2="17"
|
|
235
|
+
y2="11"
|
|
236
|
+
></line>
|
|
237
|
+
</symbol>
|
|
238
|
+
|
|
239
|
+
<!-- User with check - Extended Modules section -->
|
|
240
|
+
<symbol
|
|
241
|
+
id="icon-extends"
|
|
242
|
+
viewBox="0 0 24 24"
|
|
243
|
+
fill="none"
|
|
244
|
+
stroke="currentColor"
|
|
245
|
+
stroke-width="2"
|
|
246
|
+
stroke-linecap="round"
|
|
247
|
+
stroke-linejoin="round"
|
|
248
|
+
>
|
|
249
|
+
<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
|
|
250
|
+
<circle cx="8.5" cy="7" r="4"></circle>
|
|
251
|
+
<polyline points="17 11 19 13 23 9"></polyline>
|
|
252
|
+
</symbol>
|
|
253
|
+
|
|
254
|
+
<!-- List - Sections section -->
|
|
255
|
+
<symbol
|
|
256
|
+
id="icon-list"
|
|
257
|
+
viewBox="0 0 24 24"
|
|
258
|
+
fill="none"
|
|
259
|
+
stroke="currentColor"
|
|
260
|
+
stroke-width="2"
|
|
261
|
+
stroke-linecap="round"
|
|
262
|
+
stroke-linejoin="round"
|
|
263
|
+
>
|
|
264
|
+
<line
|
|
265
|
+
x1="8"
|
|
266
|
+
y1="6"
|
|
267
|
+
x2="21"
|
|
268
|
+
y2="6"
|
|
269
|
+
></line>
|
|
270
|
+
|
|
271
|
+
<line
|
|
272
|
+
x1="8"
|
|
273
|
+
y1="12"
|
|
274
|
+
x2="21"
|
|
275
|
+
y2="12"
|
|
276
|
+
></line>
|
|
277
|
+
|
|
278
|
+
<line
|
|
279
|
+
x1="8"
|
|
280
|
+
y1="18"
|
|
281
|
+
x2="21"
|
|
282
|
+
y2="18"
|
|
283
|
+
></line>
|
|
284
|
+
|
|
285
|
+
<line
|
|
286
|
+
x1="3"
|
|
287
|
+
y1="6"
|
|
288
|
+
x2="3.01"
|
|
289
|
+
y2="6"
|
|
290
|
+
></line>
|
|
291
|
+
|
|
292
|
+
<line
|
|
293
|
+
x1="3"
|
|
294
|
+
y1="12"
|
|
295
|
+
x2="3.01"
|
|
296
|
+
y2="12"
|
|
297
|
+
></line>
|
|
298
|
+
|
|
299
|
+
<line
|
|
300
|
+
x1="3"
|
|
301
|
+
y1="18"
|
|
302
|
+
x2="3.01"
|
|
303
|
+
y2="18"
|
|
304
|
+
></line>
|
|
305
|
+
</symbol>
|
|
306
|
+
</svg>
|
|
307
|
+
|
|
308
|
+
<header class="top-navbar">
|
|
309
|
+
<a href="./index.html" class="navbar-brand">
|
|
310
|
+
RDoc Documentation
|
|
311
|
+
</a>
|
|
312
|
+
|
|
313
|
+
<div class="navbar-search" data-search-container>
|
|
314
|
+
<button id="search-toggle" class="navbar-search-mobile" aria-label="Open search"
|
|
315
|
+
aria-controls="search-surface" aria-expanded="false" type="button">
|
|
316
|
+
<span aria-hidden="true">🔍</span>
|
|
317
|
+
</button>
|
|
318
|
+
|
|
319
|
+
<div class="search-backdrop" data-search-close></div>
|
|
320
|
+
<div id="search-surface" class="search-surface">
|
|
321
|
+
<form class="search-form" role="search" action="#" method="get" accept-charset="utf-8">
|
|
322
|
+
<span class="search-icon" aria-hidden="true">🔍</span>
|
|
323
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
324
|
+
aria-autocomplete="list" aria-controls="search-results"
|
|
325
|
+
type="text" name="search" placeholder="Search (/) for a class, method..."
|
|
326
|
+
spellcheck="false" autocomplete="off"
|
|
327
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
328
|
+
<button type="button" class="search-close" aria-label="Close search" data-search-close>
|
|
329
|
+
<span aria-hidden="true">esc</span>
|
|
330
|
+
</button>
|
|
331
|
+
</form>
|
|
332
|
+
|
|
333
|
+
<div class="search-body">
|
|
334
|
+
<ul id="search-results" aria-label="Search Results"
|
|
335
|
+
aria-busy="false" aria-expanded="false"
|
|
336
|
+
aria-atomic="false" class="initially-hidden search-results"></ul>
|
|
337
|
+
<div class="search-empty">
|
|
338
|
+
<p>No recent searches</p>
|
|
339
|
+
</div>
|
|
340
|
+
</div>
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
19
343
|
|
|
20
|
-
|
|
21
|
-
<
|
|
344
|
+
<!-- Theme toggle button -->
|
|
345
|
+
<button id="theme-toggle" class="theme-toggle" aria-label="Switch to dark mode" type="button">
|
|
346
|
+
<span class="theme-toggle-icon" aria-hidden="true">🌙</span>
|
|
347
|
+
</button>
|
|
348
|
+
</header>
|
|
22
349
|
|
|
350
|
+
<div id="sidebar-navigation-toggle" role="button" tabindex="0" aria-label="Toggle sidebar" aria-expanded="false" aria-controls="sidebar-navigation">
|
|
351
|
+
<span aria-hidden="true">☰</span>
|
|
352
|
+
</div>
|
|
23
353
|
|
|
24
|
-
<body id="top" role="document" class="file">
|
|
25
|
-
<nav role="navigation">
|
|
26
|
-
<div id="project-navigation">
|
|
27
|
-
<div id="home-section" role="region" title="Quick navigation" class="nav-section">
|
|
28
|
-
<h2>
|
|
29
|
-
<a href="./index.html" rel="home">Home</a>
|
|
30
|
-
</h2>
|
|
31
354
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<a href="./table_of_contents.html#classes">Classes</a>
|
|
35
|
-
<a href="./table_of_contents.html#methods">Methods</a>
|
|
36
|
-
</div>
|
|
37
|
-
</div>
|
|
355
|
+
<nav id="sidebar-navigation" role="navigation" hidden>
|
|
356
|
+
|
|
38
357
|
|
|
39
358
|
|
|
40
|
-
<div id="search-section" role="search" class="project-section initially-hidden">
|
|
41
|
-
<form action="#" method="get" accept-charset="utf-8">
|
|
42
|
-
<div id="search-field-wrapper">
|
|
43
|
-
<input id="search-field" role="combobox" aria-label="Search"
|
|
44
|
-
aria-autocomplete="list" aria-controls="search-results"
|
|
45
|
-
type="text" name="search" placeholder="Search" spellcheck="false"
|
|
46
|
-
title="Type to search, Up and Down to navigate, Enter to load">
|
|
47
|
-
</div>
|
|
48
359
|
|
|
49
|
-
<ul id="search-results" aria-label="Search Results"
|
|
50
|
-
aria-busy="false" aria-expanded="false"
|
|
51
|
-
aria-atomic="false" class="initially-hidden"></ul>
|
|
52
|
-
</form>
|
|
53
|
-
</div>
|
|
54
360
|
|
|
55
|
-
</div>
|
|
56
361
|
|
|
57
|
-
<div id="project-metadata">
|
|
58
|
-
|
|
59
|
-
<div id="fileindex-section" class="nav-section">
|
|
60
|
-
<h3>Pages</h3>
|
|
61
362
|
|
|
62
|
-
<
|
|
63
|
-
<
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
363
|
+
<div id="fileindex-section" class="nav-section">
|
|
364
|
+
<details class="nav-section-collapsible" open>
|
|
365
|
+
<summary class="nav-section-header">
|
|
366
|
+
<span class="nav-section-icon">
|
|
367
|
+
<svg>
|
|
368
|
+
<use href="#icon-file"></use>
|
|
369
|
+
</svg>
|
|
370
|
+
</span>
|
|
371
|
+
|
|
372
|
+
<span class="nav-section-title">Pages</span>
|
|
373
|
+
|
|
374
|
+
<span class="nav-section-chevron">
|
|
375
|
+
<svg>
|
|
376
|
+
<use href="#icon-chevron"></use>
|
|
377
|
+
</svg>
|
|
378
|
+
</span>
|
|
379
|
+
</summary>
|
|
380
|
+
|
|
381
|
+
<ul class="nav-list">
|
|
67
382
|
|
|
68
|
-
<div id="classindex-section" class="nav-section">
|
|
69
|
-
<h3>Class and Module Index</h3>
|
|
70
|
-
|
|
71
|
-
<ul class="link-list">
|
|
72
|
-
<li><details open><summary><code><a href="./Ldbws.html">Ldbws</a></code></summary>
|
|
73
|
-
<ul class="link-list">
|
|
74
|
-
<li><details><summary><code><a href="./Ldbws/Request.html">Request</a></code></summary>
|
|
75
|
-
<ul class="link-list">
|
|
76
|
-
<li><code><a href="./Ldbws/Request/GetDeparturesBoard.html">GetDeparturesBoard</a></code>
|
|
77
|
-
<li><code><a href="./Ldbws/Request/GetDeparturesBoardWithDetails.html">GetDeparturesBoardWithDetails</a></code>
|
|
78
|
-
<li><code><a href="./Ldbws/Request/GetServiceDetails.html">GetServiceDetails</a></code>
|
|
79
|
-
<li><code><a href="./Ldbws/Request/GetStationBoard.html">GetStationBoard</a></code>
|
|
80
|
-
<li><code><a href="./Ldbws/Request/GetStationBoardWithDetails.html">GetStationBoardWithDetails</a></code>
|
|
81
|
-
<li><code><a href="./Ldbws/Request/ParamValidationError.html">ParamValidationError</a></code>
|
|
82
|
-
</ul></details>
|
|
83
|
-
<li><code><a href="./Ldbws/RequestError.html">RequestError</a></code>
|
|
84
|
-
<li><code><a href="./Ldbws/ResponseParsingError.html">ResponseParsingError</a></code>
|
|
85
|
-
<li><details><summary><code><a href="./Ldbws/ResponseTypes.html">ResponseTypes</a></code></summary>
|
|
86
|
-
<ul class="link-list">
|
|
87
|
-
<li><code><a href="./Ldbws/ResponseTypes/BaseStationBoard.html">BaseStationBoard</a></code>
|
|
88
|
-
<li><code><a href="./Ldbws/ResponseTypes/CallingPoint.html">CallingPoint</a></code>
|
|
89
|
-
<li><code><a href="./Ldbws/ResponseTypes/Coach.html">Coach</a></code>
|
|
90
|
-
<li><code><a href="./Ldbws/ResponseTypes/DepartureItem.html">DepartureItem</a></code>
|
|
91
|
-
<li><code><a href="./Ldbws/ResponseTypes/DepartureItemWithDetails.html">DepartureItemWithDetails</a></code>
|
|
92
|
-
<li><code><a href="./Ldbws/ResponseTypes/DeparturesBoard.html">DeparturesBoard</a></code>
|
|
93
|
-
<li><code><a href="./Ldbws/ResponseTypes/DeparturesBoardWithDetails.html">DeparturesBoardWithDetails</a></code>
|
|
94
|
-
<li><code><a href="./Ldbws/ResponseTypes/Formation.html">Formation</a></code>
|
|
95
|
-
<li><code><a href="./Ldbws/ResponseTypes/LoadingCategory.html">LoadingCategory</a></code>
|
|
96
|
-
<li><code><a href="./Ldbws/ResponseTypes/Location.html">Location</a></code>
|
|
97
|
-
<li><code><a href="./Ldbws/ResponseTypes/ServiceDetails.html">ServiceDetails</a></code>
|
|
98
|
-
<li><code><a href="./Ldbws/ResponseTypes/ServiceItem.html">ServiceItem</a></code>
|
|
99
|
-
<li><code><a href="./Ldbws/ResponseTypes/ServiceItemWithCallingPoints.html">ServiceItemWithCallingPoints</a></code>
|
|
100
|
-
<li><code><a href="./Ldbws/ResponseTypes/StationBoard.html">StationBoard</a></code>
|
|
101
|
-
<li><code><a href="./Ldbws/ResponseTypes/StationBoardWithDetails.html">StationBoardWithDetails</a></code>
|
|
102
|
-
<li><code><a href="./Ldbws/ResponseTypes/ToiletAvailability.html">ToiletAvailability</a></code>
|
|
103
|
-
</ul></details>
|
|
104
|
-
<li><code><a href="./Ldbws/Service.html">Service</a></code>
|
|
105
|
-
</ul></details>
|
|
106
|
-
</div>
|
|
107
383
|
|
|
384
|
+
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
|
|
388
|
+
<li>
|
|
389
|
+
<a href="./LICENSE.html">
|
|
390
|
+
LICENSE
|
|
391
|
+
</a>
|
|
392
|
+
</li>
|
|
393
|
+
|
|
394
|
+
</ul>
|
|
395
|
+
</details>
|
|
108
396
|
</div>
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
<div id="classindex-section" class="nav-section">
|
|
400
|
+
<details class="nav-section-collapsible" open>
|
|
401
|
+
<summary class="nav-section-header">
|
|
402
|
+
<span class="nav-section-icon">
|
|
403
|
+
<svg><use href="#icon-layers"></use></svg>
|
|
404
|
+
</span>
|
|
405
|
+
<span class="nav-section-title">Classes and Modules</span>
|
|
406
|
+
<span class="nav-section-chevron">
|
|
407
|
+
<svg><use href="#icon-chevron"></use></svg>
|
|
408
|
+
</span>
|
|
409
|
+
</summary>
|
|
410
|
+
|
|
411
|
+
<ul class="link-list nav-list"><li><details open><summary><code><a href="./Ldbws.html">Ldbws</a></code></summary><ul class="link-list nav-list"><li><details><summary><code><a href="./Ldbws/Request.html">Request</a></code></summary><ul class="link-list nav-list"><li><code><a href="./Ldbws/Request/GetDeparturesBoard.html">GetDeparturesBoard</a></code></li><li><code><a href="./Ldbws/Request/GetDeparturesBoardWithDetails.html">GetDeparturesBoardWithDetails</a></code></li><li><code><a href="./Ldbws/Request/GetServiceDetails.html">GetServiceDetails</a></code></li><li><code><a href="./Ldbws/Request/GetStationBoard.html">GetStationBoard</a></code></li><li><code><a href="./Ldbws/Request/GetStationBoardWithDetails.html">GetStationBoardWithDetails</a></code></li><li><code><a href="./Ldbws/Request/ParamValidationError.html">ParamValidationError</a></code></li></ul></details></li><li><code><a href="./Ldbws/RequestError.html">RequestError</a></code></li><li><code><a href="./Ldbws/ResponseParsingError.html">ResponseParsingError</a></code></li><li><details><summary><code><a href="./Ldbws/ResponseTypes.html">ResponseTypes</a></code></summary><ul class="link-list nav-list"><li><code><a href="./Ldbws/ResponseTypes/BaseStationBoard.html">BaseStationBoard</a></code></li><li><code><a href="./Ldbws/ResponseTypes/CallingPoint.html">CallingPoint</a></code></li><li><code><a href="./Ldbws/ResponseTypes/Coach.html">Coach</a></code></li><li><code><a href="./Ldbws/ResponseTypes/DepartureItem.html">DepartureItem</a></code></li><li><code><a href="./Ldbws/ResponseTypes/DepartureItemWithDetails.html">DepartureItemWithDetails</a></code></li><li><code><a href="./Ldbws/ResponseTypes/DeparturesBoard.html">DeparturesBoard</a></code></li><li><code><a href="./Ldbws/ResponseTypes/DeparturesBoardWithDetails.html">DeparturesBoardWithDetails</a></code></li><li><code><a href="./Ldbws/ResponseTypes/Formation.html">Formation</a></code></li><li><code><a href="./Ldbws/ResponseTypes/LoadingCategory.html">LoadingCategory</a></code></li><li><code><a href="./Ldbws/ResponseTypes/Location.html">Location</a></code></li><li><code><a href="./Ldbws/ResponseTypes/ServiceDetails.html">ServiceDetails</a></code></li><li><code><a href="./Ldbws/ResponseTypes/ServiceItem.html">ServiceItem</a></code></li><li><code><a href="./Ldbws/ResponseTypes/ServiceItemWithCallingPoints.html">ServiceItemWithCallingPoints</a></code></li><li><code><a href="./Ldbws/ResponseTypes/StationBoard.html">StationBoard</a></code></li><li><code><a href="./Ldbws/ResponseTypes/StationBoardWithDetails.html">StationBoardWithDetails</a></code></li><li><code><a href="./Ldbws/ResponseTypes/ToiletAvailability.html">ToiletAvailability</a></code></li></ul></details></li><li><code><a href="./Ldbws/Service.html">Service</a></code></li></ul></details></li></ul>
|
|
412
|
+
</details>
|
|
413
|
+
</div>
|
|
414
|
+
|
|
109
415
|
</nav>
|
|
110
416
|
|
|
111
417
|
<main role="main">
|
|
112
418
|
|
|
419
|
+
|
|
420
|
+
<span id="label-ldbws" class="legacy-anchor"></span>
|
|
421
|
+
<h1 id="ldbws"><a href="#ldbws">ldbws</a></h1>
|
|
113
422
|
|
|
114
|
-
<
|
|
423
|
+
<p>This is a wrapper around <a href="https://lite.realtime.nationalrail.co.uk/OpenLDBWS/">Network Rail‘s Live Departure Board web service</a> (LDBWS/OpenLDBWS), allowing a much simpler querying interface. As best I can tell, all functionality is supported, although the gem currently only queries the public API.</p>
|
|
115
424
|
|
|
116
|
-
<p>
|
|
425
|
+
<p>You will need to <a href="http://realtime.nationalrail.co.uk/OpenLDBWSRegistration/">register for an API key</a> in order to use this gem.</p>
|
|
117
426
|
|
|
118
|
-
<
|
|
427
|
+
<span id="label-Installation-2Fusage" class="legacy-anchor"></span>
|
|
428
|
+
<h2 id="installationusage"><a href="#installationusage">Installation/usage</a></h2>
|
|
119
429
|
|
|
120
|
-
<
|
|
430
|
+
<p>Add <code>ldbws</code> to your Gemfile</p>
|
|
121
431
|
|
|
122
|
-
<
|
|
432
|
+
<pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-string">"</span><span class="ruby-string">ldbws</span><span class="ruby-string">"</span>
|
|
433
|
+
</pre>
|
|
434
|
+
|
|
435
|
+
<p>As long as you have an API key, you should be able to make requests against the service. Note that, per Ruby tradition, methods are written in <code>snake_case</code>, thus:</p>
|
|
123
436
|
|
|
124
|
-
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">"
|
|
437
|
+
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">"</span><span class="ruby-string">ldbws</span><span class="ruby-string">"</span>
|
|
125
438
|
|
|
126
439
|
<span class="ruby-identifier">service</span> = <span class="ruby-constant">Ldbws</span>.<span class="ruby-identifier">service</span>(<span class="ruby-constant">YOUR_API_TOKEN</span>)
|
|
127
|
-
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">service</span>.<span class="ruby-identifier">get_departure_board</span>(<span class="ruby-value">crs
|
|
440
|
+
<span class="ruby-identifier">result</span> = <span class="ruby-identifier">service</span>.<span class="ruby-identifier">get_departure_board</span>(<span class="ruby-value">crs</span><span class="ruby-value">:</span> <span class="ruby-string">"</span><span class="ruby-string">CDF</span><span class="ruby-string">"</span>) <span class="ruby-comment"># ie GetDepartureBoard</span>
|
|
128
441
|
|
|
129
|
-
<span class="ruby-identifier">puts</span> <span class="ruby-string">"
|
|
442
|
+
<span class="ruby-identifier">puts</span> <span class="ruby-string">"</span><span class="ruby-string">TIME PLAT TO</span><span class="ruby-string">"</span>
|
|
130
443
|
<span class="ruby-identifier">result</span>.<span class="ruby-identifier">train_services</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">service</span><span class="ruby-operator">|</span>
|
|
131
444
|
<span class="ruby-identifier">printf</span>(
|
|
132
|
-
<span class="ruby-string">"
|
|
133
|
-
<span class="ruby-identifier">service</span>.<span class="ruby-identifier">std</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-string">"
|
|
134
|
-
<span class="ruby-identifier">service</span>.<span class="ruby-identifier">platform</span> <span class="ruby-operator">||</span> <span class="ruby-string">"
|
|
445
|
+
<span class="ruby-string">"</span><span class="ruby-string">%s %-2s %s (%s)\n</span><span class="ruby-string">"</span>,
|
|
446
|
+
<span class="ruby-identifier">service</span>.<span class="ruby-identifier">std</span>.<span class="ruby-identifier">strftime</span>(<span class="ruby-string">"</span><span class="ruby-string">%H:%M</span><span class="ruby-string">"</span>),
|
|
447
|
+
<span class="ruby-identifier">service</span>.<span class="ruby-identifier">platform</span> <span class="ruby-operator">||</span> <span class="ruby-string">"</span><span class="ruby-string">-</span><span class="ruby-string">"</span>,
|
|
135
448
|
<span class="ruby-identifier">service</span>.<span class="ruby-identifier">destination</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">name</span>,
|
|
136
449
|
<span class="ruby-identifier">service</span>.<span class="ruby-identifier">operator</span>
|
|
137
450
|
)
|
|
@@ -146,46 +459,66 @@
|
|
|
146
459
|
<span class="ruby-comment"># [etc]</span>
|
|
147
460
|
</pre>
|
|
148
461
|
|
|
149
|
-
<
|
|
150
|
-
|
|
151
|
-
<p>LDBWS uses rate-limiting for free access: while this <em>probably</em> isn’t going to be an issue for the casual user, you may want to consider using a cache in front of this gem, just in case.</p>
|
|
462
|
+
<p>Basic validation/coercion of parameters is provided (via <a href="https://dry-rb.org/gems/dry-schema/">Dry::Schema</a>), but this is not exhaustive and should not be relied upon. In particular, CRS codes—the three letter identifier for each station—are <em>not</em> validated beyond “is it a three-letter string”.</p>
|
|
152
463
|
|
|
153
|
-
<
|
|
464
|
+
<span id="label-Error-handling" class="legacy-anchor"></span>
|
|
465
|
+
<h2 id="error-handling"><a href="#error-handling">Error-handling</a></h2>
|
|
154
466
|
|
|
155
467
|
<p>This module is pretty decent at validating request parameters, but beyond that all it can really do is just echo what LDBWS says. To wit, there are three errors that can be raised:</p>
|
|
156
468
|
|
|
157
|
-
<
|
|
469
|
+
<span id="label-Ldbws-3A-3ARequest-3A-3AParamValidationError" class="legacy-anchor"></span>
|
|
470
|
+
<h3 id="ldbwsrequestparamvalidationerror"><a href="#ldbwsrequestparamvalidationerror"><a href="Ldbws/Request/ParamValidationError.html"><code>Ldbws::Request::ParamValidationError</code></a></a></h3>
|
|
158
471
|
|
|
159
472
|
<p>This is raised when parameter validation fails. Details about exactly which parameters and why can be found using the <code>#messages</code>, and is provided in hash format, thus:</p>
|
|
160
473
|
|
|
161
474
|
<pre class="ruby"><span class="ruby-keyword">begin</span>
|
|
162
|
-
|
|
475
|
+
<span class="ruby-identifier">service</span>.<span class="ruby-identifier">get_departure_board</span>
|
|
163
476
|
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Ldbws</span><span class="ruby-operator">::</span><span class="ruby-constant">Request</span><span class="ruby-operator">::</span><span class="ruby-constant">ParamValidationError</span> <span class="ruby-operator">=></span> <span class="ruby-identifier">e</span>
|
|
164
|
-
|
|
477
|
+
<span class="ruby-comment"># e = { crs: "is missing" }</span>
|
|
165
478
|
<span class="ruby-keyword">end</span>
|
|
166
479
|
</pre>
|
|
167
480
|
|
|
168
|
-
<
|
|
481
|
+
<span id="label-Ldbws-3A-3ARequestError" class="legacy-anchor"></span>
|
|
482
|
+
<h3 id="ldbwsrequesterror"><a href="#ldbwsrequesterror"><a href="Ldbws/RequestError.html"><code>Ldbws::RequestError</code></a></a></h3>
|
|
169
483
|
|
|
170
484
|
<p>Raised when LDBWS returns an error message, usually because the request is bad (eg: invalid CRS). Unfortunately LDBWS’ error messages are pretty terrible, so it’s generally not too edifying to look at them.</p>
|
|
171
485
|
|
|
172
|
-
<
|
|
486
|
+
<span id="label-Ldbws-3A-3AResponseParsingError" class="legacy-anchor"></span>
|
|
487
|
+
<h3 id="ldbwsresponseparsingerror"><a href="#ldbwsresponseparsingerror"><a href="Ldbws/ResponseParsingError.html"><code>Ldbws::ResponseParsingError</code></a></a></h3>
|
|
173
488
|
|
|
174
489
|
<p>Raised when the response from LDBWS cannot be parsed.</p>
|
|
175
490
|
|
|
176
|
-
<
|
|
491
|
+
<span id="label-Caveats" class="legacy-anchor"></span>
|
|
492
|
+
<h2 id="caveats"><a href="#caveats">Caveats</a></h2>
|
|
177
493
|
|
|
178
494
|
<p>This is released into the world as-is. If you use it for something and end up missing your train, or do something that falls foul of the LDBWS terms of use, it’s not my fault :)</p>
|
|
179
495
|
<hr>
|
|
180
496
|
|
|
181
497
|
<p>Share and enjoy!</p>
|
|
182
498
|
|
|
499
|
+
|
|
183
500
|
</main>
|
|
184
501
|
|
|
502
|
+
<aside id="table-of-contents" class="table-of-contents" role="complementary" aria-label="Table of Contents">
|
|
503
|
+
<div class="toc-sticky">
|
|
504
|
+
<h3 class="toc-heading">On This Page</h3>
|
|
505
|
+
<nav class="toc-nav" id="toc-nav" aria-label="Page sections">
|
|
506
|
+
<!-- Generated by JavaScript based on page headings -->
|
|
507
|
+
</nav>
|
|
508
|
+
</div>
|
|
509
|
+
</aside>
|
|
510
|
+
|
|
185
511
|
|
|
186
|
-
<footer
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
<
|
|
512
|
+
<footer class="site-footer">
|
|
513
|
+
|
|
514
|
+
|
|
515
|
+
<div class="footer-bottom">
|
|
516
|
+
<p>
|
|
517
|
+
Generated by <a href="https://ruby.github.io/rdoc/">RDoc 8.1.0</a>
|
|
518
|
+
using the Aliki theme by <a href="http://st0012.dev">Stan Lo</a>
|
|
519
|
+
</p>
|
|
520
|
+
</div>
|
|
190
521
|
</footer>
|
|
191
522
|
|
|
523
|
+
</body>
|
|
524
|
+
|