Skip to content

Instantly share code, notes, and snippets.

@maxenglander
Created March 7, 2012 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxenglander/1993934 to your computer and use it in GitHub Desktop.
Save maxenglander/1993934 to your computer and use it in GitHub Desktop.
TotalPriceComparison
class TotalPriceGreaterThan
def display
"Customer spent more than #{threshold}"
end
def evaluate
receipt().total_price() > threshold()
end
def purchase
@purchase
end
def purchase= purchase
@purchase = purchase
end
def threshold
@threshold
end
def threshold= threshold
@threshold = threshold
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment