nsastorage 0.9.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nsastorage/price.rb +4 -1
- data/lib/nsastorage/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1449618a0f78eef6911c81caf0d8af5c1c3b3f372da510e7bbde4dd615f629f
|
4
|
+
data.tar.gz: 97d8d7a0814af12b1cebe8c844c5289aada32b1975a29e0fbd2fd6ae1d4ff924
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0add97c3b44b57b0f8611580e392a7c3cef55dd646c1dd67038bbb7b066ad22951fcbd2d4f425ce9438c8b811ae63b4f42c186f121ddb860dc076b0b0252067c
|
7
|
+
data.tar.gz: '0096c864db029f0dc90d9c35d5e32eed388e22c66f49085aec5173fbd079c0e06d7392afbcb19a2fe8e16e7f0198f2d091fe4c095bcab837a6efd7f5b7dd530d'
|
data/lib/nsastorage/price.rb
CHANGED
@@ -27,7 +27,10 @@ module NSAStorage
|
|
27
27
|
# @return [Array<Price>]
|
28
28
|
def self.fetch(facility_id:)
|
29
29
|
url = "https://www.nsastorage.com/facility-units/#{facility_id}"
|
30
|
-
|
30
|
+
data = Crawler.json(url:)['data']
|
31
|
+
return [] if data['error']
|
32
|
+
|
33
|
+
html = data['html']['units']
|
31
34
|
Nokogiri::HTML(html).css(PRICE_SELECTOR).map { |element| parse(element:) }
|
32
35
|
end
|
33
36
|
|
data/lib/nsastorage/version.rb
CHANGED