Skip to content

Instantly share code, notes, and snippets.

@maxenglander
Created March 7, 2012 16:17
Show Gist options
  • Save maxenglander/1994136 to your computer and use it in GitHub Desktop.
Save maxenglander/1994136 to your computer and use it in GitHub Desktop.
TotalPriceComparison
class GreaterThan
def display
"more than"
end
def evaluate one, two
one > two
end
end
class TotalPriceComparison
def comparison= comparison
@comparison
end
def display
"Customer spent #{comparison.display()} #{threshold}"
end
def evaluate
comparison.evaluate purchase.total_price, threshold
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment