 
   # Public: Returns a {Boolean} indicating whether this range has the same start
   # and end points as the given {Range} or range-compatible {Array}.
+  #
+  # * otherRange: A {Range} or range-compatible {Array}.
   isEqual: (other) ->
     return false unless other?
     other = @constructor.fromObject(other)
     other.start.isEqual(@start) and other.end.isEqual(@end)
 
-  # Public:
+  # Public: Compare two Ranges
   #
   # * other: A {Range} or range-compatible {Array}.
   #
-  # Returns:
-  #  * -1 if this range starts before the argument or contains it
-  #  * 0 if this range is equivalent to the argument.
-  #  * 1 if this range starts after the argument or is contained by it.
+  # Returns `-1` if this range starts before the argument or contains it.
+  # Returns `0` if this range is equivalent to the argument.
+  # Returns `1` if this range starts after the argument or is contained by it.
   compare: (other) ->
     other = @constructor.fromObject(other)
     if value = @start.compare(other.start)

# {Array}. This means a 2-element array containing {Point}s or point-compatible
# arrays. So the following are equivalent:
#
# ```coffee
# new Range(new Point(0, 1), new Point(2, 3))
# new Range([0, 1], [2, 3])
# [[0, 1], [2, 3]]
# ```
module.exports =
class Range
  # Public: Call this with the result of {Range::serialize} to construct a new Range.
  @deserialize: (array) ->
    new this(array...)

  # Public: Convert any range-compatible object to a {Range}.
  #
  # * object:
  #     This can be an object that's already a {Range}, in which case it's
  #     simply returned, or an array containing two {Point}s or point-compatible
  #     arrays.
  # * copy:
  #     An optional boolean indicating whether to force the copying of objects
  #     that are already ranges.
  #
  # Returns: A {Range} based on the given object.
  @fromObject: (object, copy) ->

    new @constructor(@start.translate(startPoint), @end.translate(endPoint))

  # Public: Determines whether this range intersects with the argument.
  #
  # * `otherRange` A {Range} or range-compatible {Array}
  intersectsWith: (otherRange) ->
    if @start.isLessThanOrEqual(otherRange.start)
      @end.isGreaterThanOrEqual(otherRange.start)
