Created
October 15, 2014 16:12
-
-
Save danhyun/7d71d3a145d6bafe9168 to your computer and use it in GitHub Desktop.
plain ol' groovy
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
// map based constructor | |
def nightcrawler = new Hero(name: 'Nightcrawler') | |
assert nightcrawler.name == 'Nightcrawler' | |
// with block | |
def nightcrawler = new Hero().with { h-> | |
name = 'Nightcrawler' | |
power = 'teleportation' | |
h | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment