Very Useful Snippet
Categories: goog code snippets
<cfset objMojito = createObject("component","bar.drink").init(glassType="24oz");
<cfscript>
objMojito.add("freshLime",.75).add("crushedIce","toFill").crushAndStir();
objMojito.add("rawSugar",2).add("crushedIce","toFill").add("puertoRicanRum",2).stir();
objMojito.add("clubSoda","topOff").garnish();
</cfscript>
<cfset objDoug.consume(beverage=objMojito,rate="moderate",shareWithSpouse=true) />
<cfoutput>#objDoug.getSatisfactionRating()#</cfoutput>
Subscription Options
You are not logged in, so your subscription status for this entry is unknown. You can login or register here.
Re: Very Useful Snippet
Outstanding, Doug! Nice method chaining, too ;-)
Posted by Jason Fisher on December 13, 2008 at 8:56 AM
Re: Very Useful Snippet
Nice example of method chaining :)
Posted by Dan Vega on December 13, 2008 at 11:00 AM

