Last active
June 6, 2016 12:54
-
-
Save roryl/c8c33b03651b5c4641a4a711799db735 to your computer and use it in GitHub Desktop.
Lucee Implicit Method Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
component { | |
this.triggerDataMember=true; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
component { | |
public function init(){ | |
} | |
public function setMyValue(string){ | |
this.myValue = ucase(arguments.string); | |
} | |
public function getMyValue(){ | |
return this.myValue; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
myObj = new basicComponent(); | |
myObj.setMyValue("foo"); | |
echo(myObj.getMyValue()); | |
</cfscript> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
myObj = new basicComponent(); | |
myObj.MyValue = "foo"; | |
echo(myObj.MyValue); //Outputs FOO | |
</cfscript> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* My xUnit Test | |
*/ | |
component extends="testbox.system.BaseSpec"{ | |
/*********************************** LIFE CYCLE Methods ***********************************/ | |
// executes before all test cases | |
function beforeTests(){ | |
} | |
// executes after all test cases | |
function afterTests(){ | |
} | |
// executes before every test case | |
function setup( currentMethod ){ | |
} | |
// executes after every test case | |
function teardown( currentMethod ){ | |
} | |
/*********************************** TEST CASES BELOW ***********************************/ | |
// Remember that test cases MUST start or end with the keyword 'test' | |
function checkAllSyntaxTest(){ | |
var files = directoryList(""); | |
for(file IN files){ | |
if(file CONTAINS ".cfm" AND !file CONTAINS "use_validations"){ | |
include template="#getFileFromPath(file)#"; | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
myObj = new basicComponent(); | |
myObj.myValue = "foo"; | |
writeDump(myObj.myValue); | |
myObj.setMyValue("bar"); | |
writeDump(myObj.myValue); | |
myObj.otherVar = "baz"; | |
writeDump(myObj.otherVar); | |
writeDump(myObj); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment