PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/tests/resources/EchoMember.cfc

http://github.com/atuttle/Taffy
ColdFusion CFScript | 27 lines | 22 code | 5 blank | 0 comment | 0 complexity | 935ce8fe453bd91191bd2c4daae05100 MD5 | raw file
 1<cfcomponent extends="taffy.core.resource" taffy:uri="/echo/{id}" hint="I am the component hint.">
 2
 3	<cfproperty name="dependency1" />
 4
 5	<cffunction name="get" hint="I am the function hint.">
 6		<cfargument name="id" hint="I am the argument hint." />
 7		<cfset local.headers = {}/>
 8		<cfset local.headers['x-dude'] = "dude!" />
 9		<cfset local.res = {} />
10		<cfset local.res["id"] = arguments.id />
11		<cfif structKeyExists(arguments, "dataFromOTR")>
12			<cfset local.res.dataFromOTR = arguments.dataFromOTR />
13		</cfif>
14		<cfreturn representationOf(local.res).withStatus(999).withHeaders(local.headers) />
15	</cffunction>
16
17	<cffunction name="put">
18		<cfargument name="id" />
19		<cfreturn representationOf(arguments).withStatus(200) />
20	</cffunction>
21
22	<cffunction name="post">
23		<cfargument name="id" />
24		<cfreturn representationOf(arguments).withStatus(200) />
25	</cffunction>
26
27</cfcomponent>