Skip to content

Instantly share code, notes, and snippets.

@blaix
Last active February 17, 2017 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blaix/414593c8ad08e33022e34911fc5b1df3 to your computer and use it in GitHub Desktop.
Save blaix/414593c8ad08e33022e34911fc5b1df3 to your computer and use it in GitHub Desktop.
class MyClass:
def __init__(one, two, three):
self.one = one
self.two = two
self.three = three
@classmethod
def my_factory_method(one, two, three=None):
if three is None:
return MyClassWithoutThree(one, two)
return MyClass(one, two, three)
// option 1
var ParentView = AmpersandView.extend({
createSubViews: function(opts, views) {
var context = {};
this.wwwToggleView = views.get('wwwToggleView', context);
}
});
// option 2
var ParentView = AmpersandView.extend({
createSubViews: function(opts) {
var context = {};
this.wwwToggleView = WWWToggleView.for(context);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment