compare_supermarkets 0.1.4 → 0.1.5
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be79dd9f242a73aea055493be6268a0dbcc606dedf4cfe9df3106a76b0f03c68
|
4
|
+
data.tar.gz: bcc72badfba9c2e8cd4ee0639c1c3044f43ba9eaea0c3b563d0d2eceab2bd3bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 576e362afdf6795bdb834c09b4c52c7409350b4d56e21a98b9df5ea3a2f4120f3c8d334183bdc753378075bf24ac23769ae764511c6d66f19579fe7cd731faa4
|
7
|
+
data.tar.gz: ac63b86e0c2143078c7d8789de28746fd3c9c3967118794317e310e370c8f7681760b9eaa02dcb9e70015734137e03a1945598e6a34ef6a1f329dd6b8bcc0f06
|
@@ -42,15 +42,15 @@ class CompareSupermarkets::CLI
|
|
42
42
|
self.search_supermarkets(input)
|
43
43
|
puts ""
|
44
44
|
puts ""
|
45
|
-
if CompareSupermarkets::Product.
|
45
|
+
if CompareSupermarkets::Product.count > 10
|
46
46
|
puts ""
|
47
47
|
puts "Ooo, jeez, seems like we have a lot of results."
|
48
|
-
puts "We have #{CompareSupermarkets::Product.
|
48
|
+
puts "We have #{CompareSupermarkets::Product.count} results for you."
|
49
49
|
puts "If you were a little more specific with your search"
|
50
50
|
puts "term, we would have less to sort through..."
|
51
51
|
puts ""
|
52
52
|
change_search_term
|
53
|
-
elsif CompareSupermarkets::Product.
|
53
|
+
elsif CompareSupermarkets::Product.count == 0
|
54
54
|
puts ""
|
55
55
|
puts "Ohhh man! Doesn't seem like either supermarket carry"
|
56
56
|
puts "that product."
|
@@ -58,7 +58,7 @@ class CompareSupermarkets::CLI
|
|
58
58
|
change_search_term
|
59
59
|
else
|
60
60
|
puts ""
|
61
|
-
puts "Great! We have #{CompareSupermarkets::Product.
|
61
|
+
puts "Great! We have #{CompareSupermarkets::Product.count} items for you."
|
62
62
|
puts ""
|
63
63
|
puts ""
|
64
64
|
puts ""
|
@@ -79,7 +79,7 @@ class CompareSupermarkets::CLI
|
|
79
79
|
puts ""
|
80
80
|
puts "No worries"
|
81
81
|
puts ""
|
82
|
-
if CompareSupermarkets::Product.
|
82
|
+
if CompareSupermarkets::Product.count > 0
|
83
83
|
how_to_display
|
84
84
|
else
|
85
85
|
puts ""
|
@@ -26,7 +26,7 @@ class CompareSupermarkets::Product
|
|
26
26
|
@all
|
27
27
|
end
|
28
28
|
|
29
|
-
def self.
|
29
|
+
def self.count
|
30
30
|
@@all.count
|
31
31
|
end
|
32
32
|
|
@@ -54,7 +54,7 @@ class CompareSupermarkets::Product
|
|
54
54
|
sorted = @@all.sort_by! do |s|
|
55
55
|
price_to_sort = s.dollar_value + '.' + s.cent_value
|
56
56
|
price_to_sort.to_f
|
57
|
-
|
57
|
+
end
|
58
58
|
end
|
59
59
|
|
60
60
|
def self.all_top_10_sorted_by_price
|