SHOW:
|
|
- or go back to the newest paste.
1 | app.coffee ------------------------------------------- | |
2 | ||
3 | {VariableTestLayer} = require "VariableTestLayer" | |
4 | myVarLayer = new VariableTestLayer | |
5 | - | myVarLayer.myVar = "external value" |
5 | + | myVar: "external value" |
6 | ||
7 | VariableTestLayer.coffee ----------------------------- | |
8 | ||
9 | class exports.VariableTestLayer extends Layer | |
10 | constructor: (@options={}) -> | |
11 | - | myVar = if @options.myVar? then @options.myVar else "internal value only" |
11 | + | @options.myVar ?= "internal value" |
12 | - | print myVar |
12 | + | super @options |
13 | ||
14 | print @options.myVar |