I have following code:
class Circle
constructor: (@center, @radius, @color) ->
@Red: (@center, @radius) ->
new @ center, radius, 'red'
class Point
constructor: (@x, @y) ->
I can create red circle like this: red_circle = Circle.Red(new Point(0,0), 10)
But following code doesn't work:
obj = Circle.Red
red_circle = obj(new Point(0,0), 10)
What am I doing wrong?