nsastorage 0.6.0 → 0.8.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 +10 -1
- data/lib/nsastorage/price.rb +7 -6
- 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: 25f9928da25644b2ac5762c8c400bc97d14f75421ea2f6b717931ef3b1de2ac8
|
4
|
+
data.tar.gz: 9b561d664872d11ac2478840f8f55c8daeaeef67e1e48d2b509ca033f3cfd0b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45b801b891ec0be544495c8f766d28e605a933b934d7ff2e8c60fae09480097ab764eca457bc883744c15794b35003479ff1ba45c0fc88a8a2272031f1ed2ac8
|
7
|
+
data.tar.gz: 32cd81b1a9a8a3a012e573e87cffadf79c164e4d67b4fe514ee79dd37da901b609e7ea22b6c8a05cd1b7a7526af218dad97fe5921389584fe562eb6b024d44d4
|
data/lib/nsastorage/features.rb
CHANGED
@@ -10,7 +10,7 @@ module NSAStorage
|
|
10
10
|
text = element.text
|
11
11
|
|
12
12
|
new(
|
13
|
-
climate_controlled: text.include?('
|
13
|
+
climate_controlled: text.include?('Heated and Cooled'),
|
14
14
|
drive_up_access: text.include?('Drive Up Access'),
|
15
15
|
first_floor_access: text.include?('1st Floor')
|
16
16
|
)
|
@@ -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
@@ -63,12 +63,13 @@ module NSAStorage
|
|
63
63
|
# @return [Price]
|
64
64
|
def self.parse(element:)
|
65
65
|
link = element.at_xpath(".//a[contains(text(), 'Rent')]|//a[contains(text(), 'Reserve')]")
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
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