lib/vedeu/models/line.rb in vedeu-0.4.64 vs lib/vedeu/models/line.rb in vedeu-0.4.65

- old
+ new

@@ -37,10 +37,11 @@ # @param child [void] # @return [void] def add(child) @_streams = @streams = collection.coerce(streams, self).add(child) end + alias_method :<<, :add # Returns an array of all the characters with formatting for this line. # # @return [Array] # @see Vedeu::Stream @@ -54,9 +55,18 @@ # # @return [Boolean] def empty? streams.empty? end + + # An object is equal when its values are the same. + # + # @param other [Vedeu::Collection] + # @return [Boolean] + def eql?(other) + self.class == other.class && streams == other.streams + end + alias_method :==, :eql? # @return [NilClass|String] def name parent.name if parent end