Last active
May 11, 2018 09:52
-
-
Save punneng/71587989179fe9e34b466d22ec3d5114 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| class Obj { | |
| var v1 | |
| def doSomething() { | |
| [1,2,3].forEach(i => { | |
| this.v1 = i | |
| this.v2 = random() | |
| this.validate_with_instance_variable() // (1) | |
| this.validate_with_passing_variable(i, this.v2) // (2) | |
| }) | |
| } | |
| // case (1) | |
| def validate_with_instance_variable() { | |
| // do something with this.v1 and this.v2 | |
| this.validate_other_case_with_instance_variable() | |
| } | |
| def validate_other_case_with_instance_variable() { | |
| // do something with this.v1 and this.v2 | |
| } | |
| // ------------ | |
| // case (2) | |
| def validate_with_passing_variable(arg1, arg2) { | |
| // do something with arg1 and arg2 | |
| this.validate_other_case_with_passing_variable(arg1, arg2) | |
| } | |
| def validate_other_case_with_passing_variable(arg1, arg2) { | |
| // do something with arg1 and arg2 | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment