Add deep copy to Range

This commit is contained in:
Corey Johnson & Nathan Sobo
2012-02-02 17:43:39 -08:00
parent 82366b1226
commit 803e12a201

View File

@@ -1,4 +1,5 @@
Point = require 'point'
_ = require 'underscore'
module.exports =
class Range
@@ -13,6 +14,9 @@ class Range
@start = pointB
@end = pointA
copy: (range) ->
new Range(_.clone(@start), _.clone(@end))
toString: ->
"[#{@start.toString()} - #{@end.toString()}]"