nsastorage 0.5.0 → 0.7.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/dimensions.rb +5 -0
- data/lib/nsastorage/features.rb +9 -0
- data/lib/nsastorage/price.rb +8 -7
- 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: 9537a3d82172d34af175389d2d2cc33b6fa965fd0417b063895214f07f93d332
|
4
|
+
data.tar.gz: 5b22a92987bf74ab7ec95e7a834a2abb8221df44023594309bb38b0de0714696
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19bb2a9780263f76146e6336c576d6134831697fb5cf736afe7ded2cda33dea6921848bf3b8794fd4189c3a2328cf9fa3ff80df1a0005484053085b73896f8f4
|
7
|
+
data.tar.gz: 804bc7dba4e357e73700fa4b41e765a8c7f4de4606fd310d33eb68724eb454409dff6715eebabd9eb764a77ca96fef1977edf2c31214af943b05bc4f48301cb7
|
data/lib/nsastorage/features.rb
CHANGED
@@ -36,6 +36,15 @@ module NSAStorage
|
|
36
36
|
"#<#{self.class.name} #{props.join(' ')}>"
|
37
37
|
end
|
38
38
|
|
39
|
+
# @return [String] e.g. ""
|
40
|
+
def id
|
41
|
+
[].tap do |ids|
|
42
|
+
ids << 'cc' if climate_controlled?
|
43
|
+
ids << 'dua' if drive_up_access?
|
44
|
+
ids << 'ffa' if first_floor_access?
|
45
|
+
end.join('-')
|
46
|
+
end
|
47
|
+
|
39
48
|
# @return [String] e.g. "Climate Controlled + First Floor Access"
|
40
49
|
def text
|
41
50
|
amenities.join(' + ')
|
data/lib/nsastorage/price.rb
CHANGED
@@ -62,13 +62,14 @@ module NSAStorage
|
|
62
62
|
#
|
63
63
|
# @return [Price]
|
64
64
|
def self.parse(element:)
|
65
|
-
link = element.at_xpath("
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
65
|
+
link = element.at_xpath(".//a[contains(text(), 'Rent')]|//a[contains(text(), 'Reserve')]")
|
66
|
+
dimensions = Dimensions.parse(element:)
|
67
|
+
features = Features.parse(element:)
|
68
|
+
rates = Rates.parse(element:)
|
69
|
+
|
70
|
+
id = link ? ID_REGEX.match(link['href'])[:id] : "#{dimensions.id}-#{features.id}"
|
71
|
+
|
72
|
+
new(id:, dimensions:, features:, rates:)
|
72
73
|
end
|
73
74
|
end
|
74
75
|
end
|
data/lib/nsastorage/version.rb
CHANGED