Skip to content

Instantly share code, notes, and snippets.

@phun-ky
Last active September 9, 2015 12:58
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 phun-ky/b370ff37443c698ce285 to your computer and use it in GitHub Desktop.
Save phun-ky/b370ff37443c698ce285 to your computer and use it in GitHub Desktop.
This is example one for the interpretation chapter in the article "Trusted Data"
var milk = require('milk');
var customer = require('customer');
var store = require('grocery-store');
if(store.gotEggs()){
// Buy 12 gallons
customer
.buy()
.product(milk)
.quantity(12)
.unit('gallon');
} else {
// By one gallon
customer
.buy()
.product(milk)
.quantity(1)
.unit('gallon');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment