Fix linter issues
This commit is contained in:
parent
6dfaa6946a
commit
862e6d9270
@ -5,7 +5,7 @@ module PlanetExpressExpress
|
|||||||
[:LP, :L] => 6_90,
|
[:LP, :L] => 6_90,
|
||||||
[:MR, :S] => 2_00,
|
[:MR, :S] => 2_00,
|
||||||
[:MR, :M] => 3_00,
|
[:MR, :M] => 3_00,
|
||||||
[:MR, :L] => 4_00,
|
[:MR, :L] => 4_00
|
||||||
}.freeze
|
}.freeze
|
||||||
|
|
||||||
DISCOUNT_LIMIT = 10_00
|
DISCOUNT_LIMIT = 10_00
|
||||||
|
@ -12,7 +12,7 @@ module PlanetExpressExpress
|
|||||||
if shipment[:discount] > available_budget
|
if shipment[:discount] > available_budget
|
||||||
shipment[:discount] = available_budget
|
shipment[:discount] = available_budget
|
||||||
end
|
end
|
||||||
available_budget = available_budget - shipment[:discount]
|
available_budget -= shipment[:discount]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
module PlanetExpressExpress
|
module PlanetExpressExpress
|
||||||
class Rules
|
class Rules
|
||||||
def initialize(prices)
|
def initialize(prices)
|
||||||
@lowest_s_price = prices.select { |k,v| k[1] == :S }.values.min
|
@lowest_s_price = prices.select { |k, v| k[1] == :S }.values.min
|
||||||
end
|
end
|
||||||
|
|
||||||
def apply_rules(shipments)
|
def apply_rules(shipments)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
module PlanetExpressExpress
|
module PlanetExpressExpress
|
||||||
require 'date'
|
require "date"
|
||||||
class ShipmentReader
|
class ShipmentReader
|
||||||
def initialize(prices)
|
def initialize(prices)
|
||||||
@prices = prices
|
@prices = prices
|
||||||
|
@ -16,7 +16,7 @@ RSpec.describe PlanetExpressExpress do
|
|||||||
PlanetExpressExpress::Formatter.new(output).format(shipments)
|
PlanetExpressExpress::Formatter.new(output).format(shipments)
|
||||||
|
|
||||||
expected_output = File.read(
|
expected_output = File.read(
|
||||||
File.expand_path("../fixtures/output.txt", __FILE__),
|
File.expand_path("../fixtures/output.txt", __FILE__)
|
||||||
)
|
)
|
||||||
|
|
||||||
output.rewind
|
output.rewind
|
||||||
|
Loading…
Reference in New Issue
Block a user