Skip to content

Commit e35cc73

Browse files
David LeiningerDavid Leininger
David Leininger
authored and
David Leininger
committed
Bug Fixes
1 parent 33ad302 commit e35cc73

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Bulk-and-Individual.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,19 @@ class QuantityDiscount
111111
def initialize(quantityDiscount)
112112
@discount = quantityDiscount
113113
end
114-
114+
115115
def apply(line_item)
116116
# Find quantityDiscount Object - Get Quantity/Discount
117117
quantity, discount = @discount.find do |quantity, _|
118118
line_item.quantity >= quantity
119119
end
120-
120+
121121
# Calculated the discounted line price using the line discount.
122122
discount_price = line_item.line_price - (Money.new(cents:100) * discount * line_item.quantity)
123-
123+
124124
#Caculate Total Discount
125125
total_discount = Decimal.new(discount * line_item.quantity) + 0.01
126-
126+
127127
# Set Message.
128128
message = "$#{discount} off per item when buying more than #{quantity - 1}. You saved $#{total_discount - 0.01}!"
129129

@@ -151,7 +151,7 @@ def apply(line_item)
151151
),
152152
QuantityDiscount.new(TopSeller),
153153
),
154-
154+
155155
# Quantity Breaks for Individual
156156
BulkItemCampaign.new(
157157
Individual,
@@ -161,7 +161,7 @@ def apply(line_item)
161161
),
162162
QuantityDiscount.new(Individual),
163163
),
164-
164+
165165
# Quantity Breaks for Pocket Guides
166166
BulkItemCampaign.new(
167167
PocketGuide,

0 commit comments

Comments
 (0)