Skip to content

Instantly share code, notes, and snippets.

@chrismdp
chrismdp / -
Created December 5, 2017 11:28
def assert_equal(expected, actual)
print expected == actual ? "." : "Expected #{expected.inspect} but got #{actual.inspect}\n"
end
Discount = Struct.new(:amount, :value) do
def apply(basket, item)
(basket.count(item)/amount) * value
end
end