Created
October 29, 2012 13:04
-
-
Save patricksrobertson/3973419 to your computer and use it in GitHub Desktop.
oh god dont show them how to perpetuate option hash passing in coffescript.
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
# so very bad | |
class Blerg | |
constructor: (@options = {}) -> | |
byLine: -> | |
"by #{@options.author.fullName()}" | |
category: -> | |
@options.category | |
author = new Author firstName: "Jim", lastName: "Johnson" | |
cat = new Category 'ridin dirty' | |
blagh = new Blerg author: author, category: cat | |
# betterer | |
class Blerg | |
constructor: (@author, @category) -> | |
byLine: -> | |
"by #{@author.fullName()}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment