def push(observer, priority = nil)
      raise ArgumentError, 'Observer is not callable' unless observer.respond_to?(:call)
      raise ArgumentError, 'Priority must be Fixnum' unless priority.nil? || priority.is_a?(Fixnum)

      @stack.push({ :observer => observer, :priority => (priority || default_priority) })
      sort_by_priority
      observer
    end
def push(observer, priority = nil)
      raise ArgumentError, 'Observer is not callable' unless observer.respond_to?(:call)
      raise ArgumentError, 'Priority must be Fixnum' unless priority.nil? || priority.is_a?(Fixnum)

      @stack.push({ :observer => observer, :priority => (priority || default_priority) })
      sort_by_priority
      observer
    end
Add an element to the stack with an optional priority.

 @param [#call] observer is the callable object that acts as observer.
 @param [Fixnum] priority is a number indicating return order. A higher number
   means lower priority.
 @return [#call] the original `observer` passed in.
 @raise `ArgumentError` when not using a `Fixnum` for `priority`
 @raise `ArgumentError` when not using callable object for `observer`