Skip to content

Instantly share code, notes, and snippets.

@uday-rayala
Created March 9, 2017 15:25
Show Gist options
  • Save uday-rayala/a41562bf8de299e18cf78d9087e6bb47 to your computer and use it in GitHub Desktop.
Save uday-rayala/a41562bf8de299e18cf78d9087e6bb47 to your computer and use it in GitHub Desktop.
ExperimentalEngine
class ExperimentalEngine
include Scientist
def estimate(p1, p2, p3)
science "PriceEstimate" |e|
e.context p1: p1, p2: p2, p3: p3
e.use { LocalPricingEngine.new.estimate(p1, p2, p3) }
e.try { PricingServiceEngine.new.estimate(p1, p2, p3) }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment