Skip to content

Instantly share code, notes, and snippets.

View ltrainpr's full-sized avatar

Lionel E. Ramos ltrainpr

View GitHub Profile
@mcmire
mcmire / alternate_constructor_pattern.coffee
Last active August 29, 2015 13:57
Design patterns: JavaScript vs. Ruby
# If you wanted to make a constructor that did some extra stuff
# on the newly created object before giving it back to you
# you might be tempted to write it like you would in Ruby:
class Modal
@load: ->
modal = new this
modal.load
modal