nsastorage 0.9.0 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 94e09062ff5f8bce4702b3f5f7e25f666642c619fe30be72a0e264107242dc1f
4
- data.tar.gz: 780cbe3b2b626c8af04c8d9fa588ccf7c163196de2ed7d9c83bb14b5298bd221
3
+ metadata.gz: e1449618a0f78eef6911c81caf0d8af5c1c3b3f372da510e7bbde4dd615f629f
4
+ data.tar.gz: 97d8d7a0814af12b1cebe8c844c5289aada32b1975a29e0fbd2fd6ae1d4ff924
5
5
  SHA512:
6
- metadata.gz: b17cf2b4dbc7c01bdec1632b5670cfb797d09320771339719aae168fa758b711334ad8fac2443c1f4ec8f5f0bf4ac8806e50b0e419f495c5cbcdaa7917206154
7
- data.tar.gz: 9e6d7714d6298946f20331ce25fe52f473dd3f3faa64df3a37ead1ca7e5f697015bf015d6864f78a4cdb5f82df9370879f76d7809542719bd5b14ac764702b27
6
+ metadata.gz: 0add97c3b44b57b0f8611580e392a7c3cef55dd646c1dd67038bbb7b066ad22951fcbd2d4f425ce9438c8b811ae63b4f42c186f121ddb860dc076b0b0252067c
7
+ data.tar.gz: '0096c864db029f0dc90d9c35d5e32eed388e22c66f49085aec5173fbd079c0e06d7392afbcb19a2fe8e16e7f0198f2d091fe4c095bcab837a6efd7f5b7dd530d'
@@ -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
- html = Crawler.json(url:)['data']['html']['units']
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
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NSAStorage
4
- VERSION = '0.9.0'
4
+ VERSION = '1.0.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nsastorage
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kevin Sylvestre