Created
January 31, 2018 00:16
-
-
Save Adzz/aa31e76d86efa10d9b3919a2cf1420b8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule Project do | |
def total_cost(shape = %Square{}, cost_per_square_meter) do | |
Square.area(shape) * cost_per_square_meter | |
end | |
def total_cost(shape = %Circle{}, cost_per_square_meter) do | |
Circle.area(shape) * cost_per_square_meter | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment