def reject(reason = nil)
      raise CannotTransitionError if fulfilled?
      return if rejected?
      unless resolved?
        self.reason = reason
        resolve_to(:rejected)
      end
      self
    end
def reject(reason = nil)
      raise CannotTransitionError if fulfilled?
      return if rejected?
      unless resolved?
        self.reason = reason
        resolve_to(:rejected)
      end
      self
    end
Reject this promise with an optional reason. The reason will be stored in
 the deferred and passed along to any registered `fail` callbacks.

 When rejecting a deferred twice, nothing happens.

 @raise [CannotTransitionError] when it was already fulfilled.
 @return [Deferred] self