lib/vedeu/models/escape.rb in vedeu-0.6.9 vs lib/vedeu/models/escape.rb in vedeu-0.6.10

- old
+ new

@@ -32,19 +32,36 @@ alias_method :foreground, :null alias_method :style, :null # An object is equal when its values are the same. # - # @param other [Vedeu::Views::Char] + # @param other [Vedeu::Models::Escape] # @return [Boolean] def eql?(other) self.class == other.class && value == other.value end alias_method :==, :eql? # @return [String] def position Vedeu::Geometry::Position.coerce(@position) + end + + # Return an empty hash as most escape sequences won't make + # sense as JSON. + # + # @return [Hash<void>] + def to_hash + {} + end + + # Return an empty string as most escape sequences won't make + # sense as HTML. + # + # @param options [Hash] Ignored. + # @return [String] + def to_html(_options = {}) + '' end # @return [String] def to_s "#{position}#{value}"