ldbws 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.editorconfig +1 -1
- data/Gemfile.lock +4 -4
- data/README.md +15 -9
- data/doc/README_md.html +14 -20
- data/doc/created.rid +20 -20
- data/doc/index.html +12 -9
- data/doc/js/navigation.js.gz +0 -0
- data/doc/js/search_index.js +1 -1
- data/doc/js/search_index.js.gz +0 -0
- data/doc/js/searcher.js.gz +0 -0
- data/doc/table_of_contents.html +2 -3
- data/lib/ldbws/request/get_departures_board.rb +2 -0
- data/lib/ldbws/request/get_service_details.rb +3 -1
- data/lib/ldbws/request/get_station_board.rb +3 -0
- data/lib/ldbws/service.rb +2 -4
- data/lib/ldbws/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03b396b42b0cd40bc4324244fa97031f12777ed56c0a92b93a089a2f9e0d3ec1
|
4
|
+
data.tar.gz: b7f6dd9e7d172c12463bfa8af20278361482e19cd803f7125a644e4e2fceb408
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e0084d93616722c13e03538d6d15eaf7148316aee5f8d20dd77fe1c165c9b1426514609e5c8856d39efc7219d3f86efffdaeb13de6795114968089f88d7f360
|
7
|
+
data.tar.gz: c8023c556980bea9cc084994aa9ee39abaddecdf4e74ddbb8bf1dbe2d3f1ff9c40cdaa078de31124aaea2b559aef9f51363befabe1716a0dc6460cd6998990fc
|
data/.editorconfig
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ldbws (1.0.
|
4
|
+
ldbws (1.0.3)
|
5
5
|
dry-schema (~> 1.13)
|
6
6
|
faraday (~> 2.7)
|
7
7
|
nokogiri (~> 1.14)
|
@@ -23,12 +23,12 @@ GEM
|
|
23
23
|
concurrent-ruby (~> 1.0)
|
24
24
|
dry-core (~> 1.0, < 2)
|
25
25
|
zeitwerk (~> 2.6)
|
26
|
-
dry-schema (1.13.
|
26
|
+
dry-schema (1.13.1)
|
27
27
|
concurrent-ruby (~> 1.0)
|
28
28
|
dry-configurable (~> 1.0, >= 1.0.1)
|
29
29
|
dry-core (~> 1.0, < 2)
|
30
30
|
dry-initializer (~> 3.0)
|
31
|
-
dry-logic (>= 1.
|
31
|
+
dry-logic (>= 1.4, < 2)
|
32
32
|
dry-types (>= 1.7, < 2)
|
33
33
|
zeitwerk (~> 2.6)
|
34
34
|
dry-types (1.7.1)
|
@@ -41,7 +41,7 @@ GEM
|
|
41
41
|
faraday-net_http (>= 2.0, < 3.1)
|
42
42
|
ruby2_keywords (>= 0.0.4)
|
43
43
|
faraday-net_http (3.0.2)
|
44
|
-
nokogiri (1.14.
|
44
|
+
nokogiri (1.14.3-arm64-darwin)
|
45
45
|
racc (~> 1.4)
|
46
46
|
psych (5.1.0)
|
47
47
|
stringio
|
data/README.md
CHANGED
@@ -1,18 +1,25 @@
|
|
1
|
-
# ldbws
|
1
|
+
# ldbws
|
2
2
|
|
3
|
-
|
3
|
+
This is a wrapper around [Network Rail‘s Live Departure Board web service](https://lite.realtime.nationalrail.co.uk/OpenLDBWS/) (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.
|
4
4
|
|
5
|
-
|
5
|
+
You will need to [register for an API key](http://realtime.nationalrail.co.uk/OpenLDBWSRegistration/) in order to use this gem.
|
6
6
|
|
7
|
-
## HOWTO
|
8
7
|
|
9
|
-
|
8
|
+
## Installation/usage
|
9
|
+
|
10
|
+
Add `ldbws` to your Gemfile
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
gem "ldbws"
|
14
|
+
```
|
15
|
+
|
16
|
+
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 `snake_case`, thus:
|
10
17
|
|
11
18
|
```ruby
|
12
19
|
require "ldbws"
|
13
20
|
|
14
21
|
service = Ldbws.service(YOUR_API_TOKEN)
|
15
|
-
result = service.get_departure_board(crs: "CDF")
|
22
|
+
result = service.get_departure_board(crs: "CDF") # ie GetDepartureBoard
|
16
23
|
|
17
24
|
puts "TIME PLAT TO"
|
18
25
|
result.train_services.each do |service|
|
@@ -34,9 +41,8 @@ end
|
|
34
41
|
# [etc]
|
35
42
|
```
|
36
43
|
|
37
|
-
|
38
|
-
|
39
|
-
LDBWS uses rate-limiting for free access: while this <i>probably</i> 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.
|
44
|
+
Basic validation/coercion of parameters is provided (via [Dry::Schema](https://dry-rb.org/gems/dry-schema/)), but this is not exhaustive and should not be relied upon.
|
45
|
+
In particular, CRS codes—the three letter identifier for each station—are _not_ validated beyond “is it a three-letter string”.
|
40
46
|
|
41
47
|
## Error-handling
|
42
48
|
|
data/doc/README_md.html
CHANGED
@@ -62,19 +62,10 @@
|
|
62
62
|
<ul class="link-list" role="directory">
|
63
63
|
<li>
|
64
64
|
<details open>
|
65
|
-
<summary> <a href="#label-ldbws
|
65
|
+
<summary> <a href="#label-ldbws">ldbws</a>
|
66
66
|
</summary>
|
67
67
|
<ul class="link-list" role="directory">
|
68
|
-
<li>
|
69
|
-
<details open>
|
70
|
-
<summary> <a href="#label-HOWTO">HOWTO</a>
|
71
|
-
</summary>
|
72
|
-
<ul class="link-list" role="directory">
|
73
|
-
<li> <a href="#label-A+note+about+rate+limiting">A note about rate limiting</a>
|
74
|
-
|
75
|
-
</ul>
|
76
|
-
</details>
|
77
|
-
</li>
|
68
|
+
<li> <a href="#label-Installation-2Fusage">Installation/usage</a>
|
78
69
|
<li>
|
79
70
|
<details open>
|
80
71
|
<summary> <a href="#label-Error-handling">Error-handling</a>
|
@@ -113,20 +104,25 @@
|
|
113
104
|
|
114
105
|
<main role="main" aria-label="Page README.md">
|
115
106
|
|
116
|
-
<h1 id="label-ldbws
|
107
|
+
<h1 id="label-ldbws">ldbws<span><a href="#label-ldbws">¶</a> <a href="#top">↑</a></span></h1>
|
108
|
+
|
109
|
+
<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>
|
117
110
|
|
118
|
-
<p>
|
111
|
+
<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>
|
119
112
|
|
120
|
-
<
|
113
|
+
<h2 id="label-Installation-2Fusage">Installation/usage<span><a href="#label-Installation-2Fusage">¶</a> <a href="#top">↑</a></span></h2>
|
121
114
|
|
122
|
-
<
|
115
|
+
<p>Add <code>ldbws</code> to your Gemfile</p>
|
123
116
|
|
124
|
-
<
|
117
|
+
<pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-string">"ldbws"</span>
|
118
|
+
</pre>
|
119
|
+
|
120
|
+
<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>
|
125
121
|
|
126
122
|
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">"ldbws"</span>
|
127
123
|
|
128
124
|
<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>)
|
129
|
-
<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-string">"CDF"</span>)
|
125
|
+
<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-string">"CDF"</span>) <span class="ruby-comment"># ie GetDepartureBoard</span>
|
130
126
|
|
131
127
|
<span class="ruby-identifier">puts</span> <span class="ruby-string">"TIME PLAT TO"</span>
|
132
128
|
<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>
|
@@ -148,9 +144,7 @@
|
|
148
144
|
<span class="ruby-comment"># [etc]</span>
|
149
145
|
</pre>
|
150
146
|
|
151
|
-
<
|
152
|
-
|
153
|
-
<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>
|
147
|
+
<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>
|
154
148
|
|
155
149
|
<h2 id="label-Error-handling">Error-handling<span><a href="#label-Error-handling">¶</a> <a href="#top">↑</a></span></h2>
|
156
150
|
|
data/doc/created.rid
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
Mon,
|
2
|
-
LICENSE
|
3
|
-
README.md Mon,
|
4
|
-
ldbws-1.0.
|
5
|
-
lib/ldbws/request/base.rb
|
6
|
-
lib/ldbws/request/get_departures_board.rb Sat,
|
7
|
-
lib/ldbws/request/get_service_details.rb
|
8
|
-
lib/ldbws/request/get_station_board.rb
|
9
|
-
lib/ldbws/response_types/base.rb Sat,
|
10
|
-
lib/ldbws/response_types/calling_point.rb Sat,
|
11
|
-
lib/ldbws/response_types/departures_board.rb Sat,
|
12
|
-
lib/ldbws/response_types/formation.rb Sat,
|
13
|
-
lib/ldbws/response_types/parsing_functions.rb Sat,
|
14
|
-
lib/ldbws/response_types/service_details.rb Sat,
|
15
|
-
lib/ldbws/response_types/service_item.rb Sat,
|
16
|
-
lib/ldbws/response_types/station_board.rb Sat,
|
17
|
-
lib/ldbws/service.rb
|
18
|
-
lib/ldbws/utils.rb Sat,
|
19
|
-
lib/ldbws/version.rb Mon,
|
20
|
-
lib/ldbws.rb
|
1
|
+
Mon, 10 Apr 2023 14:02:50 +0100
|
2
|
+
LICENSE Sat, 08 Apr 2023 11:42:51 +0100
|
3
|
+
README.md Mon, 10 Apr 2023 14:02:47 +0100
|
4
|
+
ldbws-1.0.3.gem Mon, 10 Apr 2023 14:00:35 +0100
|
5
|
+
lib/ldbws/request/base.rb Sat, 08 Apr 2023 23:01:22 +0100
|
6
|
+
lib/ldbws/request/get_departures_board.rb Sat, 08 Apr 2023 23:04:14 +0100
|
7
|
+
lib/ldbws/request/get_service_details.rb Mon, 10 Apr 2023 14:02:47 +0100
|
8
|
+
lib/ldbws/request/get_station_board.rb Mon, 10 Apr 2023 14:02:47 +0100
|
9
|
+
lib/ldbws/response_types/base.rb Sat, 08 Apr 2023 23:01:43 +0100
|
10
|
+
lib/ldbws/response_types/calling_point.rb Sat, 08 Apr 2023 23:01:40 +0100
|
11
|
+
lib/ldbws/response_types/departures_board.rb Sat, 08 Apr 2023 23:01:45 +0100
|
12
|
+
lib/ldbws/response_types/formation.rb Sat, 08 Apr 2023 23:01:46 +0100
|
13
|
+
lib/ldbws/response_types/parsing_functions.rb Sat, 08 Apr 2023 23:01:48 +0100
|
14
|
+
lib/ldbws/response_types/service_details.rb Sat, 08 Apr 2023 23:01:50 +0100
|
15
|
+
lib/ldbws/response_types/service_item.rb Sat, 08 Apr 2023 23:01:26 +0100
|
16
|
+
lib/ldbws/response_types/station_board.rb Sat, 08 Apr 2023 23:01:53 +0100
|
17
|
+
lib/ldbws/service.rb Sat, 08 Apr 2023 23:01:28 +0100
|
18
|
+
lib/ldbws/utils.rb Sat, 08 Apr 2023 23:01:29 +0100
|
19
|
+
lib/ldbws/version.rb Mon, 10 Apr 2023 14:02:47 +0100
|
20
|
+
lib/ldbws.rb Sat, 08 Apr 2023 23:01:52 +0100
|
data/doc/index.html
CHANGED
@@ -111,20 +111,25 @@
|
|
111
111
|
<main role="main">
|
112
112
|
|
113
113
|
|
114
|
-
<h1 id="label-ldbws
|
114
|
+
<h1 id="label-ldbws">ldbws<span><a href="#label-ldbws">¶</a> <a href="#top">↑</a></span></h1>
|
115
115
|
|
116
|
-
<p>
|
116
|
+
<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>
|
117
117
|
|
118
|
-
<p>
|
118
|
+
<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>
|
119
119
|
|
120
|
-
<h2 id="label-
|
120
|
+
<h2 id="label-Installation-2Fusage">Installation/usage<span><a href="#label-Installation-2Fusage">¶</a> <a href="#top">↑</a></span></h2>
|
121
121
|
|
122
|
-
<p>
|
122
|
+
<p>Add <code>ldbws</code> to your Gemfile</p>
|
123
|
+
|
124
|
+
<pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-string">"ldbws"</span>
|
125
|
+
</pre>
|
126
|
+
|
127
|
+
<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
128
|
|
124
129
|
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">"ldbws"</span>
|
125
130
|
|
126
131
|
<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:</span> <span class="ruby-string">"CDF"</span>)
|
132
|
+
<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-string">"CDF"</span>) <span class="ruby-comment"># ie GetDepartureBoard</span>
|
128
133
|
|
129
134
|
<span class="ruby-identifier">puts</span> <span class="ruby-string">"TIME PLAT TO"</span>
|
130
135
|
<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>
|
@@ -146,9 +151,7 @@
|
|
146
151
|
<span class="ruby-comment"># [etc]</span>
|
147
152
|
</pre>
|
148
153
|
|
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>
|
154
|
+
<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
155
|
|
153
156
|
<h2 id="label-Error-handling">Error-handling<span><a href="#label-Error-handling">¶</a> <a href="#top">↑</a></span></h2>
|
154
157
|
|
data/doc/js/navigation.js.gz
CHANGED
Binary file
|
data/doc/js/search_index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var search_data = {"index":{"searchIndex":["ldbws","request","getdeparturesboard","getdeparturesboardwithdetails","getservicedetails","getstationboard","getstationboardwithdetails","paramvalidationerror","requesterror","responseparsingerror","responsetypes","basestationboard","callingpoint","coach","departureitem","departureitemwithdetails","departuresboard","departuresboardwithdetails","formation","loadingcategory","location","servicedetails","serviceitem","serviceitemwithcallingpoints","stationboard","stationboardwithdetails","toiletavailability","service","details()","get_arr_board_with_details()","get_arr_dep_board_with_details()","get_arrival_board()","get_arrival_board_with_details()","get_arrival_departure_board()","get_arrival_departure_board_with_details()","get_dep_board_with_details()","get_departure_board()","get_departure_board_with_details()","get_fastest_departures()","get_fastest_departures_with_details()","get_next_departures()","get_next_departures_with_details()","get_service_details()","messages()","new()","service()","license","readme"],"longSearchIndex":["ldbws","ldbws::request","ldbws::request::getdeparturesboard","ldbws::request::getdeparturesboardwithdetails","ldbws::request::getservicedetails","ldbws::request::getstationboard","ldbws::request::getstationboardwithdetails","ldbws::request::paramvalidationerror","ldbws::requesterror","ldbws::responseparsingerror","ldbws::responsetypes","ldbws::responsetypes::basestationboard","ldbws::responsetypes::callingpoint","ldbws::responsetypes::coach","ldbws::responsetypes::departureitem","ldbws::responsetypes::departureitemwithdetails","ldbws::responsetypes::departuresboard","ldbws::responsetypes::departuresboardwithdetails","ldbws::responsetypes::formation","ldbws::responsetypes::loadingcategory","ldbws::responsetypes::location","ldbws::responsetypes::servicedetails","ldbws::responsetypes::serviceitem","ldbws::responsetypes::serviceitemwithcallingpoints","ldbws::responsetypes::stationboard","ldbws::responsetypes::stationboardwithdetails","ldbws::responsetypes::toiletavailability","ldbws::service","ldbws::requesterror#details()","ldbws::service#get_arr_board_with_details()","ldbws::service#get_arr_dep_board_with_details()","ldbws::service#get_arrival_board()","ldbws::service#get_arrival_board_with_details()","ldbws::service#get_arrival_departure_board()","ldbws::service#get_arrival_departure_board_with_details()","ldbws::service#get_dep_board_with_details()","ldbws::service#get_departure_board()","ldbws::service#get_departure_board_with_details()","ldbws::service#get_fastest_departures()","ldbws::service#get_fastest_departures_with_details()","ldbws::service#get_next_departures()","ldbws::service#get_next_departures_with_details()","ldbws::service#get_service_details()","ldbws::request::paramvalidationerror#messages()","ldbws::service::new()","ldbws::service()","",""],"info":[["Ldbws","","Ldbws.html","","<p>Provides a Ruby abstraction around the UK’s Network Rail live departure board webservice (LDBWS). See …\n"],["Ldbws::Request","","Ldbws/Request.html","",""],["Ldbws::Request::GetDeparturesBoard","","Ldbws/Request/GetDeparturesBoard.html","","<p>Requests a departure board for a station, filtered by departures to one or many other stations. Corresponds …\n"],["Ldbws::Request::GetDeparturesBoardWithDetails","","Ldbws/Request/GetDeparturesBoardWithDetails.html","","<p>Requests a departure board for a statuion, filtered by departures to one or more other stations. This …\n"],["Ldbws::Request::GetServiceDetails","","Ldbws/Request/GetServiceDetails.html","","<p>Returns details about a particular service. Corresponds to <code>GetServiceDetailsResponse</code> in the LDBWS schema. …\n"],["Ldbws::Request::GetStationBoard","","Ldbws/Request/GetStationBoard.html","","<p>Returns an arrival or departure board for a given station. Corresponds to <code>GetStationBoardRequest</code> in the …\n"],["Ldbws::Request::GetStationBoardWithDetails","","Ldbws/Request/GetStationBoardWithDetails.html","","<p>Returns an arrival or departure board for a given station with full service details. Corresponds to …\n"],["Ldbws::Request::ParamValidationError","","Ldbws/Request/ParamValidationError.html","","<p>Raised when an error occurs when validating request parameters. Messages are passed through directly …\n"],["Ldbws::RequestError","","Ldbws/RequestError.html","","<p>Raised when a request has resulted in an error that this library can make some sense of. This <em>usually</em> …\n"],["Ldbws::ResponseParsingError","","Ldbws/ResponseParsingError.html","","<p>Raised when a response from LDBWS cannot be parsed by this library. This is unexpected, and generally …\n"],["Ldbws::ResponseTypes","","Ldbws/ResponseTypes.html","",""],["Ldbws::ResponseTypes::BaseStationBoard","","Ldbws/ResponseTypes/BaseStationBoard.html","","<p>Base station board information. This does not directly correspond to a type in LDBWS.\n<p>Properties\n"],["Ldbws::ResponseTypes::CallingPoint","","Ldbws/ResponseTypes/CallingPoint.html","","<p>Represents a calling point in the LDBWS.\n<p>Properties\n<p>location_name — the name of the station\n"],["Ldbws::ResponseTypes::Coach","","Ldbws/ResponseTypes/Coach.html","","<p>Information about an individual coach in the train.\n<p>Properties\n<p>number — the coach number or identifier\n"],["Ldbws::ResponseTypes::DepartureItem","","Ldbws/ResponseTypes/DepartureItem.html","","<p>Represents an item on a departure board.\n<p>Properties\n<p>crs — the CRS for the item\n"],["Ldbws::ResponseTypes::DepartureItemWithDetails","","Ldbws/ResponseTypes/DepartureItemWithDetails.html","","<p>Represents an item on a departure board with additional details.\n<p>Properties\n<p>crs — the CRS for the item\n"],["Ldbws::ResponseTypes::DeparturesBoard","","Ldbws/ResponseTypes/DeparturesBoard.html","","<p>Represents a departures board.\n<p>Properties\n<p>departures — a list of departures.\n"],["Ldbws::ResponseTypes::DeparturesBoardWithDetails","","Ldbws/ResponseTypes/DeparturesBoardWithDetails.html","","<p>Represents a departures board with additional details.\n<p>Properties\n<p>departures — a list of departures.\n"],["Ldbws::ResponseTypes::Formation","","Ldbws/ResponseTypes/Formation.html","","<p>Information about the formation of a train\n<p>Properties\n<p>loading_category — how heavily-loaded the train is. …\n"],["Ldbws::ResponseTypes::LoadingCategory","","Ldbws/ResponseTypes/LoadingCategory.html","","<p>The loading category of a train\n<p>Properties\n<p>code, colour, image — \n"],["Ldbws::ResponseTypes::Location","","Ldbws/ResponseTypes/Location.html","","<p>Represents a location in LDBWS.\n<p>Properties\n<p>name, crs, via — \n"],["Ldbws::ResponseTypes::ServiceDetails","","Ldbws/ResponseTypes/ServiceDetails.html","","<p>Represents details about a service in LDBWS.\n<p>Properties\n"],["Ldbws::ResponseTypes::ServiceItem","","Ldbws/ResponseTypes/ServiceItem.html","","<p>Represents a service item in LDBWS.\n<p>Properties\n<p>sta — the scheduled arrival time as a Time object\n"],["Ldbws::ResponseTypes::ServiceItemWithCallingPoints","","Ldbws/ResponseTypes/ServiceItemWithCallingPoints.html","","<p>Represents a service item with additional details in LDBWS: extends ServiceItem.\n<p>Properties\n<p>As ServiceItem …\n"],["Ldbws::ResponseTypes::StationBoard","","Ldbws/ResponseTypes/StationBoard.html","","<p>Represents a station arrival/departure board in LDBWS.\n<p>Properties\n<p>As BaseStationBoard, and additionally: …\n"],["Ldbws::ResponseTypes::StationBoardWithDetails","","Ldbws/ResponseTypes/StationBoardWithDetails.html","","<p>Represents a station arrival/departure board with additional details in LDBWS.\n<p>Properties\n<p>As BaseStationBoard …\n"],["Ldbws::ResponseTypes::ToiletAvailability","","Ldbws/ResponseTypes/ToiletAvailability.html","","<p>The availability of an individual toilet on a train\n<p>Properties\n<p>type — the type of toilet\n"],["Ldbws::Service","","Ldbws/Service.html","","<p>A wrapper around the National Rail Live Departure Boards Webservice (LDBWS) API.\n<p>API methods are pretty …\n"],["details","Ldbws::RequestError","Ldbws/RequestError.html#method-i-details","()","<p>Returns the details of the error as a hash.\n"],["get_arr_board_with_details","Ldbws::Service","Ldbws/Service.html#method-i-get_arr_board_with_details","(params)","<p>Retrieves a detailed station arrival board.\n<p>Parameters are validated using GetStationBoardWithDetails …\n"],["get_arr_dep_board_with_details","Ldbws::Service","Ldbws/Service.html#method-i-get_arr_dep_board_with_details","(params)","<p>Retrieves a detailed station arrival + departures board.\n<p>Parameters are validated using GetStationBoardWithDetails …\n"],["get_arrival_board","Ldbws::Service","Ldbws/Service.html#method-i-get_arrival_board","(params)","<p>Retrieves a station arrival board.\n<p>Parameters are validated using GetStationBoard, returns a StationBoard …\n"],["get_arrival_board_with_details","Ldbws::Service","Ldbws/Service.html#method-i-get_arrival_board_with_details","(params)",""],["get_arrival_departure_board","Ldbws::Service","Ldbws/Service.html#method-i-get_arrival_departure_board","(params)","<p>Retrieves a station arrival + departure board.\n<p>Parameters are validated using GetStationBoard, returns …\n"],["get_arrival_departure_board_with_details","Ldbws::Service","Ldbws/Service.html#method-i-get_arrival_departure_board_with_details","(params)",""],["get_dep_board_with_details","Ldbws::Service","Ldbws/Service.html#method-i-get_dep_board_with_details","(params)","<p>Retrieves a detailed station departure board.\n<p>Parameters are validated using GetStationBoardWithDetails …\n"],["get_departure_board","Ldbws::Service","Ldbws/Service.html#method-i-get_departure_board","(params)","<p>Retrieves a station departure board.\n<p>Parameters are validated using GetStationBoard, returns a StationBoard …\n"],["get_departure_board_with_details","Ldbws::Service","Ldbws/Service.html#method-i-get_departure_board_with_details","(params)",""],["get_fastest_departures","Ldbws::Service","Ldbws/Service.html#method-i-get_fastest_departures","(params)","<p>Retrieves the fastest departures from one station to one or many others.\n<p>Parameters are validated using …\n"],["get_fastest_departures_with_details","Ldbws::Service","Ldbws/Service.html#method-i-get_fastest_departures_with_details","(params)","<p>Retrieves detailed information about the fastest departures from one station to one or many others.\n<p>Parameters …\n"],["get_next_departures","Ldbws::Service","Ldbws/Service.html#method-i-get_next_departures","(params)","<p>Retrieves the next departures from one station to one or many others.\n<p>Parameters are validated using …\n"],["get_next_departures_with_details","Ldbws::Service","Ldbws/Service.html#method-i-get_next_departures_with_details","(params)","<p>Retrieves detailed information about the next departures from one station to one or many others.\n<p>Parameters …\n"],["get_service_details","Ldbws::Service","Ldbws/Service.html#method-i-get_service_details","(params)","<p>Retrieves information about a specific service.\n<p>Parameters are validated using GetServiceDetails, returns …\n"],["messages","Ldbws::Request::ParamValidationError","Ldbws/Request/ParamValidationError.html#method-i-messages","()","<p>Returns the validation error messages as a hash.\n"],["new","Ldbws::Service","Ldbws/Service.html#method-c-new","(token)","<p>Creates a service object.\n<p>Parameters\n<p>token — the API token used to connect to the service\n"],["service","Ldbws","Ldbws.html#method-c-service","(token)","<p>Helper method that returns an instance of [Service].\n<p>Parameters\n<p>token — the API token used to connect to …\n"],["LICENSE","","LICENSE.html","","<p>MIT License\n<p>Copyright © 2022 Jon Pearse\n<p>Permission is hereby granted, free of charge, to any person obtaining …\n"],["README","","README_md.html","","<p>ldbws-ruby\n<p>I’ll write a proper readme/howto at some point, but short version is that this is a Ruby wrapper …\n"]]}}
|
1
|
+
var search_data = {"index":{"searchIndex":["ldbws","request","getdeparturesboard","getdeparturesboardwithdetails","getservicedetails","getstationboard","getstationboardwithdetails","paramvalidationerror","requesterror","responseparsingerror","responsetypes","basestationboard","callingpoint","coach","departureitem","departureitemwithdetails","departuresboard","departuresboardwithdetails","formation","loadingcategory","location","servicedetails","serviceitem","serviceitemwithcallingpoints","stationboard","stationboardwithdetails","toiletavailability","service","details()","get_arr_board_with_details()","get_arr_dep_board_with_details()","get_arrival_board()","get_arrival_board_with_details()","get_arrival_departure_board()","get_arrival_departure_board_with_details()","get_dep_board_with_details()","get_departure_board()","get_departure_board_with_details()","get_fastest_departures()","get_fastest_departures_with_details()","get_next_departures()","get_next_departures_with_details()","get_service_details()","messages()","new()","service()","license","readme"],"longSearchIndex":["ldbws","ldbws::request","ldbws::request::getdeparturesboard","ldbws::request::getdeparturesboardwithdetails","ldbws::request::getservicedetails","ldbws::request::getstationboard","ldbws::request::getstationboardwithdetails","ldbws::request::paramvalidationerror","ldbws::requesterror","ldbws::responseparsingerror","ldbws::responsetypes","ldbws::responsetypes::basestationboard","ldbws::responsetypes::callingpoint","ldbws::responsetypes::coach","ldbws::responsetypes::departureitem","ldbws::responsetypes::departureitemwithdetails","ldbws::responsetypes::departuresboard","ldbws::responsetypes::departuresboardwithdetails","ldbws::responsetypes::formation","ldbws::responsetypes::loadingcategory","ldbws::responsetypes::location","ldbws::responsetypes::servicedetails","ldbws::responsetypes::serviceitem","ldbws::responsetypes::serviceitemwithcallingpoints","ldbws::responsetypes::stationboard","ldbws::responsetypes::stationboardwithdetails","ldbws::responsetypes::toiletavailability","ldbws::service","ldbws::requesterror#details()","ldbws::service#get_arr_board_with_details()","ldbws::service#get_arr_dep_board_with_details()","ldbws::service#get_arrival_board()","ldbws::service#get_arrival_board_with_details()","ldbws::service#get_arrival_departure_board()","ldbws::service#get_arrival_departure_board_with_details()","ldbws::service#get_dep_board_with_details()","ldbws::service#get_departure_board()","ldbws::service#get_departure_board_with_details()","ldbws::service#get_fastest_departures()","ldbws::service#get_fastest_departures_with_details()","ldbws::service#get_next_departures()","ldbws::service#get_next_departures_with_details()","ldbws::service#get_service_details()","ldbws::request::paramvalidationerror#messages()","ldbws::service::new()","ldbws::service()","",""],"info":[["Ldbws","","Ldbws.html","","<p>Provides a Ruby abstraction around the UK’s Network Rail live departure board webservice (LDBWS). See …\n"],["Ldbws::Request","","Ldbws/Request.html","",""],["Ldbws::Request::GetDeparturesBoard","","Ldbws/Request/GetDeparturesBoard.html","","<p>Requests a departure board for a station, filtered by departures to one or many other stations. Corresponds …\n"],["Ldbws::Request::GetDeparturesBoardWithDetails","","Ldbws/Request/GetDeparturesBoardWithDetails.html","","<p>Requests a departure board for a statuion, filtered by departures to one or more other stations. This …\n"],["Ldbws::Request::GetServiceDetails","","Ldbws/Request/GetServiceDetails.html","","<p>Returns details about a particular service. Corresponds to <code>GetServiceDetailsResponse</code> in the LDBWS schema. …\n"],["Ldbws::Request::GetStationBoard","","Ldbws/Request/GetStationBoard.html","","<p>Returns an arrival or departure board for a given station. Corresponds to <code>GetStationBoardRequest</code> in the …\n"],["Ldbws::Request::GetStationBoardWithDetails","","Ldbws/Request/GetStationBoardWithDetails.html","","<p>Returns an arrival or departure board for a given station with full service details. Corresponds to …\n"],["Ldbws::Request::ParamValidationError","","Ldbws/Request/ParamValidationError.html","","<p>Raised when an error occurs when validating request parameters. Messages are passed through directly …\n"],["Ldbws::RequestError","","Ldbws/RequestError.html","","<p>Raised when a request has resulted in an error that this library can make some sense of. This <em>usually</em> …\n"],["Ldbws::ResponseParsingError","","Ldbws/ResponseParsingError.html","","<p>Raised when a response from LDBWS cannot be parsed by this library. This is unexpected, and generally …\n"],["Ldbws::ResponseTypes","","Ldbws/ResponseTypes.html","",""],["Ldbws::ResponseTypes::BaseStationBoard","","Ldbws/ResponseTypes/BaseStationBoard.html","","<p>Base station board information. This does not directly correspond to a type in LDBWS.\n<p>Properties\n"],["Ldbws::ResponseTypes::CallingPoint","","Ldbws/ResponseTypes/CallingPoint.html","","<p>Represents a calling point in the LDBWS.\n<p>Properties\n<p>location_name — the name of the station\n"],["Ldbws::ResponseTypes::Coach","","Ldbws/ResponseTypes/Coach.html","","<p>Information about an individual coach in the train.\n<p>Properties\n<p>number — the coach number or identifier\n"],["Ldbws::ResponseTypes::DepartureItem","","Ldbws/ResponseTypes/DepartureItem.html","","<p>Represents an item on a departure board.\n<p>Properties\n<p>crs — the CRS for the item\n"],["Ldbws::ResponseTypes::DepartureItemWithDetails","","Ldbws/ResponseTypes/DepartureItemWithDetails.html","","<p>Represents an item on a departure board with additional details.\n<p>Properties\n<p>crs — the CRS for the item\n"],["Ldbws::ResponseTypes::DeparturesBoard","","Ldbws/ResponseTypes/DeparturesBoard.html","","<p>Represents a departures board.\n<p>Properties\n<p>departures — a list of departures.\n"],["Ldbws::ResponseTypes::DeparturesBoardWithDetails","","Ldbws/ResponseTypes/DeparturesBoardWithDetails.html","","<p>Represents a departures board with additional details.\n<p>Properties\n<p>departures — a list of departures.\n"],["Ldbws::ResponseTypes::Formation","","Ldbws/ResponseTypes/Formation.html","","<p>Information about the formation of a train\n<p>Properties\n<p>loading_category — how heavily-loaded the train is. …\n"],["Ldbws::ResponseTypes::LoadingCategory","","Ldbws/ResponseTypes/LoadingCategory.html","","<p>The loading category of a train\n<p>Properties\n<p>code, colour, image — \n"],["Ldbws::ResponseTypes::Location","","Ldbws/ResponseTypes/Location.html","","<p>Represents a location in LDBWS.\n<p>Properties\n<p>name, crs, via — \n"],["Ldbws::ResponseTypes::ServiceDetails","","Ldbws/ResponseTypes/ServiceDetails.html","","<p>Represents details about a service in LDBWS.\n<p>Properties\n"],["Ldbws::ResponseTypes::ServiceItem","","Ldbws/ResponseTypes/ServiceItem.html","","<p>Represents a service item in LDBWS.\n<p>Properties\n<p>sta — the scheduled arrival time as a Time object\n"],["Ldbws::ResponseTypes::ServiceItemWithCallingPoints","","Ldbws/ResponseTypes/ServiceItemWithCallingPoints.html","","<p>Represents a service item with additional details in LDBWS: extends ServiceItem.\n<p>Properties\n<p>As ServiceItem …\n"],["Ldbws::ResponseTypes::StationBoard","","Ldbws/ResponseTypes/StationBoard.html","","<p>Represents a station arrival/departure board in LDBWS.\n<p>Properties\n<p>As BaseStationBoard, and additionally: …\n"],["Ldbws::ResponseTypes::StationBoardWithDetails","","Ldbws/ResponseTypes/StationBoardWithDetails.html","","<p>Represents a station arrival/departure board with additional details in LDBWS.\n<p>Properties\n<p>As BaseStationBoard …\n"],["Ldbws::ResponseTypes::ToiletAvailability","","Ldbws/ResponseTypes/ToiletAvailability.html","","<p>The availability of an individual toilet on a train\n<p>Properties\n<p>type — the type of toilet\n"],["Ldbws::Service","","Ldbws/Service.html","","<p>A wrapper around the National Rail Live Departure Boards Webservice (LDBWS) API.\n<p>API methods are pretty …\n"],["details","Ldbws::RequestError","Ldbws/RequestError.html#method-i-details","()","<p>Returns the details of the error as a hash.\n"],["get_arr_board_with_details","Ldbws::Service","Ldbws/Service.html#method-i-get_arr_board_with_details","(params)","<p>Retrieves a detailed station arrival board.\n<p>Parameters are validated using GetStationBoardWithDetails …\n"],["get_arr_dep_board_with_details","Ldbws::Service","Ldbws/Service.html#method-i-get_arr_dep_board_with_details","(params)","<p>Retrieves a detailed station arrival + departures board.\n<p>Parameters are validated using GetStationBoardWithDetails …\n"],["get_arrival_board","Ldbws::Service","Ldbws/Service.html#method-i-get_arrival_board","(params)","<p>Retrieves a station arrival board.\n<p>Parameters are validated using GetStationBoard, returns a StationBoard …\n"],["get_arrival_board_with_details","Ldbws::Service","Ldbws/Service.html#method-i-get_arrival_board_with_details","(params)",""],["get_arrival_departure_board","Ldbws::Service","Ldbws/Service.html#method-i-get_arrival_departure_board","(params)","<p>Retrieves a station arrival + departure board.\n<p>Parameters are validated using GetStationBoard, returns …\n"],["get_arrival_departure_board_with_details","Ldbws::Service","Ldbws/Service.html#method-i-get_arrival_departure_board_with_details","(params)",""],["get_dep_board_with_details","Ldbws::Service","Ldbws/Service.html#method-i-get_dep_board_with_details","(params)","<p>Retrieves a detailed station departure board.\n<p>Parameters are validated using GetStationBoardWithDetails …\n"],["get_departure_board","Ldbws::Service","Ldbws/Service.html#method-i-get_departure_board","(params)","<p>Retrieves a station departure board.\n<p>Parameters are validated using GetStationBoard, returns a StationBoard …\n"],["get_departure_board_with_details","Ldbws::Service","Ldbws/Service.html#method-i-get_departure_board_with_details","(params)",""],["get_fastest_departures","Ldbws::Service","Ldbws/Service.html#method-i-get_fastest_departures","(params)","<p>Retrieves the fastest departures from one station to one or many others.\n<p>Parameters are validated using …\n"],["get_fastest_departures_with_details","Ldbws::Service","Ldbws/Service.html#method-i-get_fastest_departures_with_details","(params)","<p>Retrieves detailed information about the fastest departures from one station to one or many others.\n<p>Parameters …\n"],["get_next_departures","Ldbws::Service","Ldbws/Service.html#method-i-get_next_departures","(params)","<p>Retrieves the next departures from one station to one or many others.\n<p>Parameters are validated using …\n"],["get_next_departures_with_details","Ldbws::Service","Ldbws/Service.html#method-i-get_next_departures_with_details","(params)","<p>Retrieves detailed information about the next departures from one station to one or many others.\n<p>Parameters …\n"],["get_service_details","Ldbws::Service","Ldbws/Service.html#method-i-get_service_details","(params)","<p>Retrieves information about a specific service.\n<p>Parameters are validated using GetServiceDetails, returns …\n"],["messages","Ldbws::Request::ParamValidationError","Ldbws/Request/ParamValidationError.html#method-i-messages","()","<p>Returns the validation error messages as a hash.\n"],["new","Ldbws::Service","Ldbws/Service.html#method-c-new","(token)","<p>Creates a service object.\n<p>Parameters\n<p>token — the API token used to connect to the service\n"],["service","Ldbws","Ldbws.html#method-c-service","(token)","<p>Helper method that returns an instance of [Service].\n<p>Parameters\n<p>token — the API token used to connect to …\n"],["LICENSE","","LICENSE.html","","<p>MIT License\n<p>Copyright © 2022 Jon Pearse\n<p>Permission is hereby granted, free of charge, to any person obtaining …\n"],["README","","README_md.html","","<p>ldbws\n<p>This is a wrapper around Network Rail‘s Live Departure Board web service (LDBWS/OpenLDBWS), allowing …\n"]]}}
|
data/doc/js/search_index.js.gz
CHANGED
Binary file
|
data/doc/js/searcher.js.gz
CHANGED
Binary file
|
data/doc/table_of_contents.html
CHANGED
@@ -34,9 +34,8 @@
|
|
34
34
|
<a href="README_md.html">README</a>
|
35
35
|
|
36
36
|
<ul>
|
37
|
-
<li><a href="README_md.html#label-ldbws
|
38
|
-
<li><a href="README_md.html#label-
|
39
|
-
<li><a href="README_md.html#label-A+note+about+rate+limiting">A note about rate limiting</a>
|
37
|
+
<li><a href="README_md.html#label-ldbws">ldbws</a>
|
38
|
+
<li><a href="README_md.html#label-Installation-2Fusage">Installation/usage</a>
|
40
39
|
<li><a href="README_md.html#label-Error-handling">Error-handling</a>
|
41
40
|
<li><a href="README_md.html#label-Ldbws-3A-3ARequest-3A-3AParamValidationError"><code>Ldbws::Request::ParamValidationError</code></a>
|
42
41
|
<li><a href="README_md.html#label-Ldbws-3A-3ARequestError"><code>Ldbws::RequestError</code></a>
|
@@ -14,6 +14,8 @@ module Ldbws::Request
|
|
14
14
|
class GetDeparturesBoard < Base
|
15
15
|
# :nodoc:
|
16
16
|
SCHEMA = Dry::Schema.Params do
|
17
|
+
config.validate_keys = true
|
18
|
+
|
17
19
|
required(:crs).filled(Types::Crs)
|
18
20
|
required(:filter_list).array(Types::Crs, min_size?: 1)
|
19
21
|
optional(:time_offset).filled(:integer)
|
@@ -10,6 +10,8 @@ module Ldbws::Request
|
|
10
10
|
class GetServiceDetails < Base
|
11
11
|
# :nodoc:
|
12
12
|
SCHEMA = Dry::Schema.Params do
|
13
|
+
config.validate_keys = true
|
14
|
+
|
13
15
|
required(:service_id).filled(:string)
|
14
16
|
end
|
15
17
|
|
@@ -22,7 +24,7 @@ module Ldbws::Request
|
|
22
24
|
# :nodoc:
|
23
25
|
def to_soap_params
|
24
26
|
{
|
25
|
-
serviceID: @params[:service_id],
|
27
|
+
serviceID: @params[:service_id].upcase,
|
26
28
|
}
|
27
29
|
end
|
28
30
|
end
|
@@ -16,6 +16,8 @@ module Ldbws::Request
|
|
16
16
|
class GetStationBoard < Base
|
17
17
|
# :nodoc:
|
18
18
|
SCHEMA = Dry::Schema.Params do
|
19
|
+
config.validate_keys = true
|
20
|
+
|
19
21
|
required(:crs).filled(Types::Crs)
|
20
22
|
optional(:num_rows).filled(:integer)
|
21
23
|
optional(:filter_crs).filled(Types::Crs)
|
@@ -36,6 +38,7 @@ module Ldbws::Request
|
|
36
38
|
# CRSes should always be upcased
|
37
39
|
params[:crs].upcase!
|
38
40
|
params[:filter_crs].upcase! if params[:filter_crs]
|
41
|
+
params[:filter_type].downcase! if params[:filter_crs]
|
39
42
|
|
40
43
|
# filter type isn’t needed if we’re not filtering
|
41
44
|
params.delete(:filter_type) unless params[:filter_crs]
|
data/lib/ldbws/service.rb
CHANGED
@@ -202,17 +202,15 @@ module Ldbws
|
|
202
202
|
end
|
203
203
|
|
204
204
|
def perform_soap_request(action, body)
|
205
|
-
uri = URI(SERVICE_URI)
|
206
|
-
|
207
205
|
conn = Faraday.new(
|
208
|
-
url: "#{
|
206
|
+
url: "#{SERVICE_URI.scheme}://#{SERVICE_URI.host}",
|
209
207
|
headers: {
|
210
208
|
'Content-Type': "text/xml",
|
211
209
|
'SOAPAction': action,
|
212
210
|
},
|
213
211
|
)
|
214
212
|
|
215
|
-
conn.post(
|
213
|
+
conn.post(SERVICE_URI.path, body).body
|
216
214
|
end
|
217
215
|
|
218
216
|
def extract_error(xml)
|
data/lib/ldbws/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ldbws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Pearse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-04-
|
11
|
+
date: 2023-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-schema
|
@@ -221,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
221
221
|
- !ruby/object:Gem::Version
|
222
222
|
version: '0'
|
223
223
|
requirements: []
|
224
|
-
rubygems_version: 3.
|
224
|
+
rubygems_version: 3.3.7
|
225
225
|
signing_key:
|
226
226
|
specification_version: 4
|
227
227
|
summary: Interface to the Network Rail OpenLDBS web service
|