Created
April 12, 2012 20:10
-
-
Save thurloat/2370656 to your computer and use it in GitHub Desktop.
Hardcore Coffeescript
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
class @SyncView | |
for season in ["spring", "summer", "fall", "winter"] | |
for field in ["title", "story"] | |
fieldPropertyName = season + field.charAt(0).toUpperCase() + field.substr(1) | |
pName = "#{ fieldPropertyName }ToModel" | |
TrendFormView.prototype[pName] = _.bind (s, f) -> | |
@seasonFieldToModel s, f | |
, TrendFormView.prototype, season, field |
generate mah own methods at runtime
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
lols