snowreports 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/snowreports.rb +2 -2
- data/lib/snowreports/endpoint.rb +23 -23
- data/lib/snowreports/fetcher.rb +3 -2
- data/lib/snowreports/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f3ac517a409ab9c3b1fa866a384ba64d8738f476ac13bd13277cec1a1cc902d9
|
4
|
+
data.tar.gz: 3d462de002f1d08ecf753adf8b19625a1299cee91c6b919585a61b1cbd93f762
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cc03c78899d2aecd76d13d0399df4cdf710ab74d01470159c02f3e37f3f65fc91dc8fffca216071200bd6c6844e6d062671f9ca2312a4a1a8ca00c788a79ea7
|
7
|
+
data.tar.gz: d76874832dae9de1e1ab89135b08bee495c7ea20a8e3eb5da3c6bfcf6532111b6359ab50023d4438621ee2b34253b2fb4ee63156f4e6bb3389e9fecfec5312d0
|
data/lib/snowreports.rb
CHANGED
@@ -6,13 +6,13 @@ require_relative "snowreports/fetcher"
|
|
6
6
|
module Snowreports
|
7
7
|
def self.fetch(ski_field)
|
8
8
|
endpoint = Endpoint.all.fetch(ski_field)
|
9
|
-
response = Fetcher.fetch(
|
9
|
+
response = Fetcher.fetch(snowhq_id: endpoint.snowhq_id)
|
10
10
|
Builder.build(xml: response.body, field_id: endpoint.id)
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.all
|
14
14
|
Endpoint.all.each_with_object([]) do |(_field_name, endpoint), acc|
|
15
|
-
response = Fetcher.fetch(
|
15
|
+
response = Fetcher.fetch(snowhq_id: endpoint.snowhq_id)
|
16
16
|
acc << Builder.build(xml: response.body, field_id: endpoint.id)
|
17
17
|
acc
|
18
18
|
end
|
data/lib/snowreports/endpoint.rb
CHANGED
@@ -1,31 +1,31 @@
|
|
1
1
|
module Snowreports
|
2
2
|
class Endpoint
|
3
|
-
SnowpoolWrapper = Struct.new(:id, :
|
3
|
+
SnowpoolWrapper = Struct.new(:id, :snowhq_id)
|
4
4
|
|
5
5
|
def self.all
|
6
6
|
@all ||= {
|
7
|
-
turoa: SnowpoolWrapper.new(22,
|
8
|
-
whakapapa: SnowpoolWrapper.new(21,
|
9
|
-
cardrona: SnowpoolWrapper.new(15,
|
10
|
-
treble_cone: SnowpoolWrapper.new(7,
|
11
|
-
remarkables: SnowpoolWrapper.new(6,
|
12
|
-
coronet_peak: SnowpoolWrapper.new(14,
|
13
|
-
snow_farm: SnowpoolWrapper.new(18,
|
14
|
-
manganui: SnowpoolWrapper.new(24,
|
15
|
-
rainbow: SnowpoolWrapper.new(20,
|
16
|
-
mt_hutt: SnowpoolWrapper.new(8,
|
17
|
-
mt_cheeseman: SnowpoolWrapper.new(3,
|
18
|
-
hanmer_springs: SnowpoolWrapper.new(9,
|
19
|
-
broken_river: SnowpoolWrapper.new(4,
|
20
|
-
my_lyford: SnowpoolWrapper.new(16,
|
21
|
-
craigieburn: SnowpoolWrapper.new(10,
|
22
|
-
porters: SnowpoolWrapper.new(1,
|
23
|
-
mt_olympus: SnowpoolWrapper.new(5,
|
24
|
-
temple_basin: SnowpoolWrapper.new(2,
|
25
|
-
ohau: SnowpoolWrapper.new(12,
|
26
|
-
mt_dobson: SnowpoolWrapper.new(13,
|
27
|
-
roundhill: SnowpoolWrapper.new(17,
|
28
|
-
fox_peak: SnowpoolWrapper.new(11,
|
7
|
+
turoa: SnowpoolWrapper.new(22, 9),
|
8
|
+
whakapapa: SnowpoolWrapper.new(21, 10),
|
9
|
+
cardrona: SnowpoolWrapper.new(15, 2),
|
10
|
+
treble_cone: SnowpoolWrapper.new(7, 4),
|
11
|
+
remarkables: SnowpoolWrapper.new(6, 6),
|
12
|
+
coronet_peak: SnowpoolWrapper.new(14,5),
|
13
|
+
snow_farm: SnowpoolWrapper.new(18, 24),
|
14
|
+
manganui: SnowpoolWrapper.new(24, 14),
|
15
|
+
rainbow: SnowpoolWrapper.new(20, 12),
|
16
|
+
mt_hutt: SnowpoolWrapper.new(8, 7),
|
17
|
+
mt_cheeseman: SnowpoolWrapper.new(3, 16),
|
18
|
+
hanmer_springs: SnowpoolWrapper.new(9, 20),
|
19
|
+
broken_river: SnowpoolWrapper.new(4, 13),
|
20
|
+
my_lyford: SnowpoolWrapper.new(16, 15),
|
21
|
+
craigieburn: SnowpoolWrapper.new(10, 17),
|
22
|
+
porters: SnowpoolWrapper.new(1, 3),
|
23
|
+
mt_olympus: SnowpoolWrapper.new(5, 19),
|
24
|
+
temple_basin: SnowpoolWrapper.new(2, 18),
|
25
|
+
ohau: SnowpoolWrapper.new(12, 11),
|
26
|
+
mt_dobson: SnowpoolWrapper.new(13, 8),
|
27
|
+
roundhill: SnowpoolWrapper.new(17, 23),
|
28
|
+
fox_peak: SnowpoolWrapper.new(11, 22),
|
29
29
|
}
|
30
30
|
end
|
31
31
|
end
|
data/lib/snowreports/fetcher.rb
CHANGED
data/lib/snowreports/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snowreports
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Davey
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
version: '0'
|
138
138
|
requirements: []
|
139
139
|
rubyforge_project:
|
140
|
-
rubygems_version: 2.
|
140
|
+
rubygems_version: 2.7.9
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: Fetches and parses reports from snowreports.co.nz
|